guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: python-typer: Run more tests.


From: guix-commits
Subject: 01/03: gnu: python-typer: Run more tests.
Date: Thu, 18 Nov 2021 12:01:32 -0500 (EST)

rekado pushed a commit to branch core-updates-frozen
in repository guix.

commit 9e76a5b7cb84534bcda7507773b681f13df11698
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Nov 18 16:58:44 2021 +0000

    gnu: python-typer: Run more tests.
    
    * gnu/packages/python-xyz.scm (python-typer)[arguments]: Delete phase
    'disable-failing-tests; disable only test_show_completion and
    test_install_completion in 'check phase; add phase 'patch-shell-reference.
---
 gnu/packages/python-xyz.scm | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 603ef2a..e9ec5ff 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20855,30 +20855,30 @@ based on the CPython 2.7 and 3.7 parsers.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-before 'check 'disable-failing-tests
+         ;; Unfortunately, this doesn't seem to be enough to fix these two
+         ;; tests, but we'll patch this anyway.
+         (add-after 'unpack 'patch-shell-reference
            (lambda _
              (substitute* "tests/test_completion/test_completion.py"
-               (("def test_show_completion")
-                "def _test_show_completion")
-               (("def test_install_completion")
-                "def _test_install_completion"))
-             (substitute* "tests/test_completion/test_completion_install.py"
-               (("def test_completion_install_bash")
-                "def _test_completion_install_bash")
-               (("def test_completion_install_zsh")
-                "def _test_completion_install_zsh")
-               (("def test_completion_install_fish")
-                "def _test_completion_install_fish")
-               (("def test_completion_install_powershell")
-                "def _test_completion_install_powershell"))
-             #t))
+               (("\"bash\"") (string-append "\"" (which "bash") "\""))
+               (("\"/bin/bash\"") (string-append "\"" (which "bash") "\"")))))
          (replace 'check
            (lambda _
+             (setenv "HOME" "/tmp") ; some tests need it
+
+             ;; This is for completion tests
+             (with-output-to-file "/tmp/.bashrc" (lambda _ (display "# 
dummy")))
+
              (setenv "PYTHONPATH"
                      (string-append (getcwd) ":"
                                     (getenv "PYTHONPATH")))
-             (invoke "python" "-m" "pytest" "tests/")
-             #t)))))
+             (let ((disabled-tests (list "test_show_completion"
+                                         "test_install_completion")))
+               (invoke "python" "-m" "pytest" "tests/"
+                       "-k"
+                       (string-append "not "
+                                      (string-join disabled-tests
+                                                   " and not ")))))))))
     (propagated-inputs
      `(("python-click" ,python-click)))
     (native-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]