guix_mirror_bot pushed a commit to branch astro-update
in repository guix.

commit ab6ec9095c8c35a8c22456381cdaaa817d61b71d
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Thu Jan 15 10:26:15 2026 +0000

    gnu: python-astroquery: Simplify and improve tests.
    
    * gnu/packages/astronomy.scm (python-astroquery):
    [arguments] <test-flags>: Rework skipped tests.
    <phases>: Use default 'check; add 'pre-check.
    [native-inputs]: Add python-pytest-rerunfailures and
    python-pytest-timeout.
    [propagated-inputs]: Sort a->z; group by priority.
    
    Change-Id: I54db4c66d8f97829e7015074e3c26d22629e4999
---
 gnu/packages/astronomy.scm | 47 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index c5083a60c0..dabcbff320 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -3346,53 +3346,48 @@ celestial-to-terrestrial coordinate transformations.")
     (build-system pyproject-build-system)
     (arguments
      (list
+      ;; Tests are not thread save, see:
+      ;; <https://github.com/astropy/astroquery/issues/2968>.
+      ;; 
+      ;; tests: 1823 passed, 21 skipped, 2047 deselected, 2 xfailed
       #:test-flags
       #~(list "--pyargs" "astroquery"
               "-m" "not remote_data"
-              ;; Some tests failed with parallel run, see
-              ;; <https://github.com/astropy/astroquery/issues/2968>.
-              ;; "-n" "auto"
               "-k" (string-join
-                    (list
-                     ;; Failed: DID NOT RAISE <class
-                     ;; 'astropy.utils.exceptions.AstropyDeprecationWarning'>
-                     "not test_raises_deprecation_warning"
-                     ;; E       fixture 'tmp_cwd' not found
-                     "test_download_cache"
-                     "test_download_local"
-                     "test_download_table"
-                     "test_read_uncompressed")
+                    ;; E fixture 'tmp_cwd' not found
+                    (list "not test_download_cache"
+                          "test_download_local"
+                          "test_download_table"
+                          "test_read_uncompressed")
                     " and not "))
       #:phases
       #~(modify-phases %standard-phases
-          (replace 'check
-            (lambda* (#:key tests? test-flags #:allow-other-keys)
-              (when tests?
-                ;; Some tests require write access to $HOME.
-                (setenv "HOME" "/tmp")
-                ;; 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))))))))
+          (add-before 'check 'pre-check
+            (lambda _
+              (setenv "HOME" "/tmp")
+              (delete-file-recursively "astroquery"))))))
     (native-inputs
      (list nss-certs-for-test
            python-matplotlib
            python-pytest-astropy
            python-pytest-dependency
            python-pytest-doctestplus
+           python-pytest-rerunfailures
+           python-pytest-timeout
            python-setuptools))
     (propagated-inputs
      (list python-astropy
-           python-astropy-healpix
            python-beautifulsoup4
-           python-boto3
            python-html5lib
            python-keyring
-           ;; python-mocpy : Not packed yet, optional and Rust is required
            python-numpy
            python-pyvo
-           python-regions
-           python-requests))
+           python-requests
+           ;; [optional]
+           python-astropy-healpix
+           python-boto3
+           ;; python-mocpy      ;not packaged yet in Guix
+           python-regions))
     (home-page "https://astroquery.readthedocs.io/en/latest/index.html";)
     (synopsis "Access online astronomical data resources")
     (description

Reply via email to