guix-commits
[Top][All Lists]
Advanced

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

01/05: gnu: python-attrs: Conditionally execute tests.


From: guix-commits
Subject: 01/05: gnu: python-attrs: Conditionally execute tests.
Date: Mon, 7 Jun 2021 04:54:43 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit 12964df69a99de6190422c752fef65ef813f3b6b
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Jun 7 10:49:43 2021 +0200

    gnu: python-attrs: Conditionally execute tests.
    
    * gnu/packages/python-xyz.scm (python-attrs)[arguments]: Wrap "check" phase 
in
    conditional expression.
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6a6d7f4..e3f5295 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16991,18 +16991,20 @@ and bit flag values.")
                   (ice-9 ftw)
                   (srfi srfi-1)
                   (srfi srfi-26))
-       #:phases (modify-phases %standard-phases
-                  (replace 'check
-                    (lambda _
-                      (let ((cwd (getcwd)))
-                        (setenv "PYTHONPATH"
-                                (string-append
-                                 cwd "/build/"
-                                 (find (cut string-prefix? "lib" <>)
-                                       (scandir (string-append cwd "/build")))
-                                 ":"
-                                 (getenv "PYTHONPATH")))
-                        (invoke "python" "-m" "pytest")))))))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (let ((cwd (getcwd)))
+                 (setenv "PYTHONPATH"
+                         (string-append
+                          cwd "/build/"
+                          (find (cut string-prefix? "lib" <>)
+                                (scandir (string-append cwd "/build")))
+                          ":"
+                          (getenv "PYTHONPATH")))
+                 (invoke "python" "-m" "pytest"))))))))
     (native-inputs
      `(("python-coverage" ,python-coverage)
        ("python-hypothesis" ,python-hypothesis)



reply via email to

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