astropy / pytest-remotedata

Pytest plugin to control whether tests are run that have remote data
BSD 3-Clause "New" or "Revised" License
23 stars 15 forks source link

RemovedInPytest4Warning: MarkInfo objects are deprecated #31

Closed pllim closed 5 years ago

pllim commented 6 years ago

This warning is currently ignored as per astropy/astropy#7490 but still should be addressed at some point?

    def pytest_runtest_setup(item):

        remote_data = item.get_marker('remote_data')
        internet_off = item.get_marker('internet_off')

        remote_data_config = item.config.getvalue("remote_data")

        if remote_data is not None and internet_off is not None:
            raise ValueError("remote_data and internet_off are not compatible")

        if remote_data is not None:
>           source = remote_data.kwargs.get('source', 'any')
E           _pytest.deprecated.RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
E           Please use node.get_closest_marker(name) or node.iter_markers(name).
E           Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
/home/travis/miniconda/envs/test/lib/python3.6/site-packages/pytest_remotedata/plugin.py:68: RemovedInPytest4Warning

https://github.com/astropy/pytest-remotedata/blob/v0.3.0/pytest_remotedata/plugin.py#L76