gnu: python-typer: Run tests conditionally.

* gnu/packages/python-xyz.scm (python-typer)[arguments]: Only run tests when
TESTS? is #true.
This commit is contained in:
Ricardo Wurmus 2021-11-18 17:00:48 +00:00
parent 3b1cf6ab5e
commit 9d0c5f18e7
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -20863,22 +20863,23 @@ based on the CPython 2.7 and 3.7 parsers.")
(("\"bash\"") (string-append "\"" (which "bash") "\"")) (("\"bash\"") (string-append "\"" (which "bash") "\""))
(("\"/bin/bash\"") (string-append "\"" (which "bash") "\""))))) (("\"/bin/bash\"") (string-append "\"" (which "bash") "\"")))))
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
(setenv "HOME" "/tmp") ; some tests need it (when tests?
(setenv "HOME" "/tmp") ; some tests need it
;; This is for completion tests ;; This is for completion tests
(with-output-to-file "/tmp/.bashrc" (lambda _ (display "# dummy"))) (with-output-to-file "/tmp/.bashrc" (lambda _ (display "# dummy")))
(setenv "GUIX_PYTHONPATH" (setenv "GUIX_PYTHONPATH"
(string-append (getcwd) ":" (string-append (getcwd) ":"
(getenv "GUIX_PYTHONPATH"))) (getenv "GUIX_PYTHONPATH")))
(let ((disabled-tests (list "test_show_completion" (let ((disabled-tests (list "test_show_completion"
"test_install_completion"))) "test_install_completion")))
(invoke "python" "-m" "pytest" "tests/" (invoke "python" "-m" "pytest" "tests/"
"-k" "-k"
(string-append "not " (string-append "not "
(string-join disabled-tests (string-join disabled-tests
" and not "))))))))) " and not "))))))))))
(propagated-inputs (propagated-inputs
`(("python-click" ,python-click))) `(("python-click" ,python-click)))
(native-inputs (native-inputs