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

tests failures against Pytest 7.2.0 #8757

Closed
stanislavlevin opened this issue Nov 14, 2022 · 0 comments · Fixed by #8758
Closed

tests failures against Pytest 7.2.0 #8757

stanislavlevin opened this issue Nov 14, 2022 · 0 comments · Fixed by #8758

Comments

@stanislavlevin
Copy link
Contributor

https://docs.pytest.org/en/latest/changelog.html#pytest-7-2-0-2022-10-23:

#9886: The functionality for running tests written for nose has been officially deprecated.
This includes:

  • Plain setup and teardown functions and methods: this might catch users by surprise, as setup() and teardown() are not pytest idioms, but part of the nose support.
  • Setup/teardown using the @with_setup decorator.

For more details, consult the deprecation docs.

This leads to identical errors in djangorestframework's tests

...
/usr/lib/python3/site-packages/_pytest/python.py:909: in xunit_setup_method_fixture
    warnings.warn(
E   pytest.PytestRemovedIn8Warning: Support for nose tests is deprecated and will be r
emoved in a future release.
E   tests/test_serializer_nested.py::TestNotRequiredNestedSerializerWithMany::test_mul
tipart_validate is using nose-specific method: `setup(self)`
E   To remove this warning, rename it to `setup_method(self)`
E   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-wr
itten-for-nose
...
==== 1178 passed, 124 skipped, 1 xpassed, 2 warnings, 122 errors in 39.40s =====
stanislavlevin added a commit to stanislavlevin/django-rest-framework that referenced this issue Nov 14, 2022
Pytest 7.2.0 deprecated plain `setup` and `teardown` functions and
methods as nose idioms:
https://docs.pytest.org/en/latest/changelog.html#pytest-7-2-0-2022-10-23

`setup` can be safely replaced with `setup_method`:
https://docs.pytest.org/en/stable/deprecations.html#setup-teardown

Fixes: encode#8757
Signed-off-by: Stanislav Levin <slev@altlinux.org>
tomchristie pushed a commit that referenced this issue Nov 15, 2022
Pytest 7.2.0 deprecated plain `setup` and `teardown` functions and
methods as nose idioms:
https://docs.pytest.org/en/latest/changelog.html#pytest-7-2-0-2022-10-23

`setup` can be safely replaced with `setup_method`:
https://docs.pytest.org/en/stable/deprecations.html#setup-teardown

Fixes: #8757
Signed-off-by: Stanislav Levin <slev@altlinux.org>

Signed-off-by: Stanislav Levin <slev@altlinux.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant