Skip to content

TST: 9 failures in test_angles.py in devinfra job #16016

@pllim

Description

@pllim

Probably something changed again in pytest-dev . Just started seeing this today. I restarted a previously passing job on main and it fails now: https://github.com/astropy/astropy/actions/runs/7780284592/job/21375925091

All failures are similar in nature as this:

>       with pytest.warns(IllegalMinuteWarning):
astropy/coordinates/tests/test_angles.py:495: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
wrn = <warnings.WarningMessage object at 0x7fc1da718650>
    @staticmethod
    def _validate_message(wrn: Any) -> None:
        if not isinstance(msg := wrn.message.args[0], str):
>           raise TypeError(
                f"Warning message must be str, got {msg!r} (type {type(msg).__name__})"
            )
E           TypeError: Warning message must be str, got 60 (type int)
_pytest/recwarn.py:340: TypeError
FAILED coordinates/tests/test_angles.py::test_negative_sixty_hm - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_plus_sixty_hm - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_negative_fifty_nine_sixty_dms - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_plus_fifty_nine_sixty_dms - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_negative_sixty_dms - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_plus_sixty_dms - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_angle_to_is_angle - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_angle_to_quantity - TypeError: Warning message must be str, got 60 (type int)
FAILED coordinates/tests/test_angles.py::test_angle_string - TypeError: Warning message must be str, got 60 (type int)

Caused by:

Because we have:

class IllegalMinuteWarning(AstropyWarning):
"""
Raised when a minute value is 60.
Parameters
----------
minute : int, float
"""
def __init__(self, minute, alternativeactionstr=None):
self.minute = minute
self.alternativeactionstr = alternativeactionstr

Reported to:

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