~ruther/guix-local

43d6e5eefb69e79a53b9b5b632ce1a350d9a2610 — Sharlatan Hellseher 1 year, 2 months ago cf633f1
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
1 files changed, 13 insertions(+), 4 deletions(-)

M gnu/packages/astronomy.scm
M gnu/packages/astronomy.scm => gnu/packages/astronomy.scm +13 -4
@@ 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