aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/astronomy.scm21
1 files changed, 8 insertions, 13 deletions
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index ca30ff60a0..0df5dc84e4 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -4348,19 +4348,14 @@ object.")
(list
#:phases
#~(modify-phases %standard-phases
- (add-before 'check 'prepare-test-environment
- (lambda _
- (invoke "python" "setup.py" "build_ext" "--inplace")
- ;; To solve pytest/conftest issue. Pytest tries to load all
- ;; files with word 'test' in them.
- ;;
- ;; ImportError while loading conftest ...
- ;; _pytest.pathlib.ImportPathMismatchError: ...
- ;;
- (call-with-output-file "pytest.ini"
- (lambda (port)
- (format port "[pytest]
-python_files = test_*.py"))))))))
+ (replace 'check
+ (lambda* (#:key tests? test-flags #:allow-other-keys)
+ (when tests?
+ (invoke "python" "setup.py" "build_ext" "--inplace")
+ ;; Step out of the source directory to avoid interference; we
+ ;; want to run the installed code with extensions etc.
+ (with-directory-excursion "/tmp"
+ (apply invoke "pytest" "-v" test-flags))))))))
(propagated-inputs
(list python-astropy
python-dust-extinction