[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: gnu: python-typer: Run tests conditionally.
From: |
guix-commits |
Subject: |
03/03: gnu: python-typer: Run tests conditionally. |
Date: |
Thu, 18 Nov 2021 12:01:32 -0500 (EST) |
rekado pushed a commit to branch core-updates-frozen
in repository guix.
commit 9d0c5f18e7c763ee8815f49865d057c2a65ff313
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Nov 18 17:00:48 2021 +0000
gnu: python-typer: Run tests conditionally.
* gnu/packages/python-xyz.scm (python-typer)[arguments]: Only run tests when
TESTS? is #true.
---
gnu/packages/python-xyz.scm | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3115d36..1f086ed 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20863,22 +20863,23 @@ based on the CPython 2.7 and 3.7 parsers.")
(("\"bash\"") (string-append "\"" (which "bash") "\""))
(("\"/bin/bash\"") (string-append "\"" (which "bash") "\"")))))
(replace 'check
- (lambda _
- (setenv "HOME" "/tmp") ; some tests need it
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (setenv "HOME" "/tmp") ; some tests need it
- ;; This is for completion tests
- (with-output-to-file "/tmp/.bashrc" (lambda _ (display "#
dummy")))
+ ;; This is for completion tests
+ (with-output-to-file "/tmp/.bashrc" (lambda _ (display "#
dummy")))
- (setenv "GUIX_PYTHONPATH"
- (string-append (getcwd) ":"
- (getenv "GUIX_PYTHONPATH")))
- (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 ")))))))))
+ (setenv "GUIX_PYTHONPATH"
+ (string-append (getcwd) ":"
+ (getenv "GUIX_PYTHONPATH")))
+ (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