sharlatan pushed a commit to branch master in repository guix. commit 43d6e5eefb69e79a53b9b5b632ce1a350d9a2610 Author: Sharlatan Hellseher <sharlata...@gmail.com> AuthorDate: Wed May 7 22:52:28 2025 +0100
gnu: python-sunpy: Fix tests. * gnu/packages/astronomy.scm (python-sunpy) [arguments] <test-flags>: Skip one test introducing time bomb. <phases>: Add 'pre-check and move set HOME here from 'check. Change-Id: I20e3f63aa45c951bd7b093e0d02e4968aca87dc3 --- gnu/packages/astronomy.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 00924c2890..4dc5c13cfc 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -7415,18 +7415,27 @@ and @code{astropy}.") (list #:test-flags #~(list "--pyargs" "sunpy" - "--numprocesses" (number->string (min 8 (parallel-job-count)))) + "--numprocesses" (number->string (min 8 (parallel-job-count))) + ;; Test introduces a time bomb and fails with error: ValueError: + ;; interpolating from IERS_Auto using predictive values that are + ;; more than 30.0 days old. + "-k" "not test_print_params") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'remove-test-files + ;; Requires SpicePy wich is not packed in Guix yet and can't be + ;; ignored with Pytet options for some reason. (lambda _ - ;; Requires SpicePy wich is not packed in Guix yet and can't be - ;; ignored with Pytet options for some reason. (delete-file "sunpy/coordinates/tests/test_spice.py"))) + (add-before 'check 'pre-check + ;; It requires during sanity check as well to prevent error like: + ;; PermissionError: [Errno 13] Permission denied: + ;; '/homeless-shelter' + (lambda _ + (setenv "HOME" "/tmp"))) (replace 'check (lambda* (#:key tests? test-flags #:allow-other-keys) (when tests? - (setenv "HOME" "/tmp") (with-directory-excursion "/tmp" (apply invoke "pytest" "-vv" test-flags)))))))) (native-inputs