Skip to content

tests failures against Pytest 7.2.0 #8757

Closed
@stanislavlevin

Description

@stanislavlevin

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 =====

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions