gnu: python-attrs: Conditionally execute tests.

* gnu/packages/python-xyz.scm (python-attrs)[arguments]: Wrap "check" phase in
conditional expression.
This commit is contained in:
Ricardo Wurmus 2021-06-07 10:49:43 +02:00
parent a8c653f0fc
commit 12964df69a
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -16991,9 +16991,11 @@ and bit flag values.")
(ice-9 ftw) (ice-9 ftw)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26)) (srfi srfi-26))
#:phases (modify-phases %standard-phases #:phases
(modify-phases %standard-phases
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
(when tests?
(let ((cwd (getcwd))) (let ((cwd (getcwd)))
(setenv "PYTHONPATH" (setenv "PYTHONPATH"
(string-append (string-append
@ -17002,7 +17004,7 @@ and bit flag values.")
(scandir (string-append cwd "/build"))) (scandir (string-append cwd "/build")))
":" ":"
(getenv "PYTHONPATH"))) (getenv "PYTHONPATH")))
(invoke "python" "-m" "pytest"))))))) (invoke "python" "-m" "pytest"))))))))
(native-inputs (native-inputs
`(("python-coverage" ,python-coverage) `(("python-coverage" ,python-coverage)
("python-hypothesis" ,python-hypothesis) ("python-hypothesis" ,python-hypothesis)