Subject: [bug#51314] [PATCH 08/29] gnu: python-flask: Respect #:tests?.

From: Vinicius Monego <[email-masked]>
Date: Thu, 21 Oct 2021 04:01:39 +0000

* gnu/packages/python-web.scm (python-flask)[arguments]<#:phases>: Respect
#:tests? in the custom 'check phase and simplify it.
---
 gnu/packages/python-web.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 67128d1b18..8dd3345daf 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -2981,13 +2981,13 @@ minimum of WSGI.")
                 "15ni4xlm57a15f5hipp8w0c9zba20179bvfns2392fiq1lcbdghg"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (replace 'check
-           (lambda _
-             (setenv "PYTHONPATH" (string-append "./build/lib:"
-                                                 (getenv "PYTHONPATH")))
-             (invoke "pytest" "-vv" "tests"))))))
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest")))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (propagated-inputs
-- 
2.30.2