astropy / pyvo

An Astropy affiliated package providing access to remote data and services of the Virtual Observatory (VO) using Python.
https://pyvo.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
74 stars 50 forks source link

Unit test fail: astropy.utils.exceptions.AstropyDeprecationWarning #547

Closed Hellseher closed 2 months ago

Hellseher commented 2 months ago

Hi,

During monthly refresh of astro related packages in Guix I've faced with the issue where pyvo@1.5.1 has one unit tests failed when astropy is bumped to 6.1.0

=================================== FAILURES ===================================
___________________ TestTables.test_single_table_description ___________________

self = <pyvo.io.vosi.tests.test_tables.TestTables object at 0x7fff68448f10>

    def test_single_table_description(self):
        """Test describing a table with a single description
        """
        tableset = vosi.parse_tables(
            get_pkg_data_filename(
                "data/tables/single_table_description.xml"))
        onedesc_table = tableset.get_first_table()
        describe_string = 'A test table with a single description'
        assert describe_string in onedesc_table.description

        with io.StringIO() as buf, contextlib.redirect_stdout(buf):
>           onedesc_table.describe()

pyvo/io/vosi/tests/test_tables.py:401:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyvo/io/vosi/vodataservice.py:321: in describe
    print(indent(self.description))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ('A test table with a single description',), kwargs = {}
category = <class 'astropy.utils.exceptions.AstropyDeprecationWarning'>

    def deprecated_func(*args, **kwargs):
        if pending:
            category = AstropyPendingDeprecationWarning
        else:
            category = warning_type

>       warnings.warn(message, category, stacklevel=2)
E       astropy.utils.exceptions.AstropyDeprecationWarning: The indent function is deprecated and may be removed in a future version.
E               Use textwrap.indent() instead.

/gnu/store/8f7d54vwk07r6z2vdkjk8frbdh2mkvvx-python-astropy-6.1.0/lib/python3.10/site-packages/astropy/utils/decorators.py:131: AstropyDeprecationWarning
=========================== short test summary info ============================
FAILED pyvo/io/vosi/tests/test_tables.py::TestTables::test_single_table_description
============= 1 failed, 307 passed, 43 skipped, 1 xfailed in 2.33s =============

Inputs:

Thanks, Oleg

bsipocz commented 2 months ago

Thanks Oleg for the report. This has been fixed by https://github.com/astropy/pyvo/pull/539

Hellseher commented 2 months ago

I guess that changes will be availalbe in the next release.

bsipocz commented 2 months ago

Yes. Either 1.5.2 or 1.6, whichever comes first, we likely will come up with a plan or ETA next week when some of the maintainers will be in the same room.