Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest 8 deprecated nose support #3883

Closed
maartenbreddels opened this issue Feb 8, 2024 · 1 comment · Fixed by #3903
Closed

pytest 8 deprecated nose support #3883

maartenbreddels opened this issue Feb 8, 2024 · 1 comment · Fixed by #3903

Comments

@maartenbreddels
Copy link
Member

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

@frenzymadness
Copy link
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

def setup():
setup_test_comm()
def teardown():
teardown_test_comm()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants