pytest 8 deprecated nose support
maartenbreddels opened this issue · comments
With pytest 8 we now get the warning:
ERROR ipywidgets/tests/test_embed.py::TestEmbed::test_minimal_html_filename - pytest.PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
ipywidgets/tests/test_embed.py::TestEmbed::test_minimal_html_filename is using nose-specific method: `teardown(self)`
To remove this warning, rename it to `teardown_method(self)`
See docs: [https://docs.pytest.org/en/stable/deprecations.html#suppor](https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose)
We currently fail on warnings. We should probably modify our test and unpin pytest (pinning of < 8 originally done in #3866 )
I think this is a great project for a (new) contributor
There seems to be more than the warning now. We are testing ipywidgets with pytest 8 and we're getting a lot of failures like:
____________________________ test_empty_send_state _____________________________
def test_empty_send_state():
w = SimpleWidget()
w.send_state([])
> assert w.comm.messages == []
E AttributeError: 'DummyComm' object has no attribute 'messages'
and that seems to be caused by pytests ignoring setup/teardown functions in
ipywidgets/python/ipywidgets/ipywidgets/widgets/tests/utils.py
Lines 90 to 94 in b78de43