Skip to content

Test Failures Encountered When Running Pytest in Astropy Development Version #15788

Closed

Description

@tanvincible

Description

While testing the Astropy Development Version, some tests failed running Pytest.

Expected behavior

All the tests should have passed or otherwise xfailed.

How to Reproduce

  1. Setup Astropy Development Version as stated here.

  2. Then run the following command:

    pip install -e ".[test]"
  3. The test completes with FAILURES.

======================================================================== short test summary info ========================================================================
FAILED astropy/coordinates/tests/test_representation.py::TestCartesianRepresentation::test_transform_non_contiguous_matrix - assert False
FAILED astropy/visualization/tests/test_units.py::test_units - ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled
FAILED astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py::TestDisplayWorldCoordinate::test_cube_coords - ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled
FAILED astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py::TestDisplayWorldCoordinate::test_cube_coords_uncorr_slicing - ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled
FAILED astropy/visualization/wcsaxes/tests/test_misc.py::test_slicing_warnings - ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled
FAILED astropy/visualization/wcsaxes/tests/test_misc.py::test_grid_type_contours_transform - ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled
FAILED astropy/visualization/wcsaxes/tests/test_misc.py::test_bbox_size[0.2] - assert False
FAILED astropy/visualization/wcsaxes/tests/test_misc.py::test_bbox_size[1e-08] - assert False
================================================= 8 failed, 28248 passed, 317 skipped, 246 xfailed in 874.83s (0:14:34) =================================================

Versions

Windows-10-10.0.22631-SP0
Python 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:26:23) [MSC v.1916 64 bit (AMD64)]
astropy 6.1.dev238+gf5909190d5
Numpy 1.24.3
pyerfa 2.0.0
Scipy 1.11.1
Matplotlib 3.8.2

Activity

  1. github-actions commented on Dec 23, 2023

    @github-actions
    Contributor

    Welcome to Astropy 👋 and thank you for your first issue!

    A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.

    GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.

    If you feel that this issue has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].

  2. MridulS commented on Dec 23, 2023

    @MridulS
    Contributor

    Interesting, this is a matplotlib issue.
    Can you try running this code in a python console in your dev env:

    import matplotlib
    matplotlib.get_cache_dir()
    
  3. tanvincible commented on Dec 24, 2023

    @tanvincible
    ContributorAuthor

    @MridulS - I tried accessing the cache directory of Matplotlib, seems like it doesn't exist in my system.

    >>> import matplotlib
    
    >>> matplotlib.get_cache_dir()
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    Cell In[3], line 1
    ----> 1 matplotlib.get_cache_dir()
    
    File ~\anaconda3\Lib\site-packages\matplotlib\_api\__init__.py:217, in caching_module_getattr.<locals>.__getattr__(name)
        215 if name in props:
        216     return props[name].__get__(instance)
    --> 217 raise AttributeError(
        218     f"module {cls.__module__!r} has no attribute {name!r}")
    
    AttributeError: module 'matplotlib' has no attribute 'get_cache_dir'

    I checked the Matplotlib directory and found only one file fontlist-v330.json.

  4. MridulS commented on Dec 25, 2023

    @MridulS
    Contributor

    Hmm, could you just try doing the installation again? (start from scratch and remove the environment). This is probably a matplotlib installation issue on windows, not an astropy one.

  5. eerovaher commented on Dec 25, 2023

    @eerovaher
    Member

    The one test that fails in coordinates is a regression test for a bug in pyerfa that was fixed in pyerfa 2.0.1.1 (see #15511). Our CI tests use the latest version of pyerfa, so the test succeeds, but astropy also supports older versions without the bugfix:

    "pyerfa>=2.0",
    It is therefore indeed possible to have a failing test even though the astropy development version is properly installed. There are two simple possible solutions to this: 1) skip the test if the installed version of pyerfa doesn't have the bugfix, or 2) update the minimum required pyerfa version. Both would be simple to implement, but I'm not sure which of the two would be preferable.

    The test is not failing in our oldestdeps CI job because that job also uses pyerfa 2.0.1.1 despite that being the latest version:

    oldestdeps: pyerfa==2.0.*

    To me it looks like the oldestdeps job isn't properly configured, but tox configuration is not really my area of responsibility, so I'm not sure if any changes should be made there.

  6. eerovaher commented on Jan 10, 2024

    @eerovaher
    Member

    I don't know about the failures regarding matplotlib, but the problem in coordinates is real.

  7. mhvk commented on Jan 11, 2024

    @mhvk
    Contributor

    @eerovaher - nice sleuthing! I think we should go for your second suggestion, of updating our minimum requirement. pyerfa is a bit special compared to numpy, etc., in that we are in control of it (used to be developed inside astropy), and I think the particular bug could bite people in ways that are very opague.

  8. mhvk commented on Jan 11, 2024

    @mhvk
    Contributor

    See #15865 for discussion about how we should set olddestdeps (and version limits more generally).

  9. eerovaher commented on Mar 8, 2024

    @eerovaher
    Member

    The problem in coordinates has been fixed and it looks like the problems in visualization were not caused by us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions