Skip to content

TST: 2 failing tests on Python 3.15 #19503

Description

@neutrinoceros

I'm starting to check for compatibility against Python 3.15 (currently alpha-7)
The first blocker is an upstream issue in pygments, but it's already fixed on the dev branch so it's easy enough to just install it from the repo.

two other failures remain that may be on our side, or regressions in CPython itself (clarification needed):

astropy/modeling/tests/test_functional_models.py F                                                                                           [ 50%]
docs/coordinates/skycoord.rst F                                                                                                              [100%]

===================================================================== FAILURES =====================================================================
_________________________________________________________ test_Shift_inverse_bounding_box __________________________________________________________

    def test_Shift_inverse_bounding_box():
        model = models.Shift(10)
        model.bounding_box = (1, 5)
        assert model.bounding_box == (1, 5)

>       inverse_model = model.inverse
                        ^^^^^^^^^^^^^

astropy/modeling/tests/test_functional_models.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astropy/modeling/core.py:1380: in inverse
    result = self._inverse()
             ^^^^^^^^^^^^^^^
astropy/modeling/functional_models.py:602: in inverse
    inv.bounding_box = tuple(
                       ^^^^^
astropy/modeling/functional_models.py:603: in <genexpr>
    self.evaluate(x, self.offset) for x in self.bounding_box
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = Interval(lower=1, upper=5), offset = Parameter('offset', value=10.0)

    @staticmethod
    def evaluate(x, offset):
        """One dimensional Shift model function."""
>       return x + offset
               ^^^^^^^^^^
E       TypeError: can only concatenate tuple (not "Parameter") to tuple

astropy/modeling/functional_models.py:611: TypeError
______________________________________________________________ [doctest] skycoord.rst ______________________________________________________________
869     <SkyCoord (ICRS): (x, y, z) in kpc
870         (1., 2., 3.)>
871
872     >>> c.representation_type = 'cylindrical'
873     >>> c  # doctest: +FLOAT_CMP
874     <SkyCoord (ICRS): (rho, phi, z) in (kpc, deg, kpc)
875         (2.23606798, 63.43494882, 3.)>
876     >>> c.phi.to(u.deg)  # doctest: +FLOAT_CMP
877     <Angle 63.43494882 deg>
878     >>> c.x
Differences (unified diff with -expected +actual):
    @@ -1,3 +1,7 @@
     Traceback (most recent call last):
    -...
    -AttributeError: 'SkyCoord' object has no attribute 'x'
    +  File "<doctest skycoord.rst[88]>", line 1, in <module>
    +    c.x
    +  File "/Users/clm/dev/gh/astropy/astropy/astropy/coordinates/sky_coordinate.py", line 745, in __getattr__
    +    return self.__getattribute__(attr)
    +           ~~~~~~~~~~~~~~~~~~~~~^^^^^^
    +AttributeError: 'SkyCoord' object has no attribute 'x'. Did you mean '.cartesian.x' instead of '.x'?

/Users/clm/dev/gh/astropy/astropy/docs/coordinates/skycoord.rst:878: DocTestFailure
============================================================= short test summary info ==============================================================
FAILED astropy/modeling/tests/test_functional_models.py::test_Shift_inverse_bounding_box - TypeError: can only concatenate tuple (not "Parameter") to tuple
FAILED docs/coordinates/skycoord.rst::skycoord.rst

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions