encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
28.21k stars 6.81k forks source link

3.15.1: pytest fails wit error in `tests/test_testing.py::TestUrlPatternTestCase::test_urlpatterns` unit #9422

Open wuch-g2v opened 4 months ago

wuch-g2v commented 4 months ago

Checklist

Looks like something is wrong and pytest fails in one unit

==================================== ERRORS ====================================
_________ ERROR at teardown of TestUrlPatternTestCase.test_urlpatterns _________
tests/test_testing.py:323: in check_urlpatterns
    assert urlpatterns is not cls.urlpatterns
E   AssertionError: assert [<URLPattern ''>] is not [<URLPattern ''>]
E    +  where [<URLPattern ''>] = <class 'tests.test_testing.TestUrlPatternTestCase'>.urlpatterns
=============================== warnings summary ===============================
../../../../../usr/lib/python3.10/site-packages/_pytest/config/__init__.py:1448
  /usr/lib/python3.10/site-packages/_pytest/config/__init__.py:1448: PytestConfigWarning: Unknown config option: testspath

    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

tests/test_authtoken.py::AuthTokenTests::test_authtoken_can_be_imported_when_not_included_in_installed_apps
  /usr/lib/python3.10/site-packages/django/db/models/base.py:366: RuntimeWarning: Model 'authtoken.token' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

tests/test_authtoken.py::AuthTokenTests::test_authtoken_can_be_imported_when_not_included_in_installed_apps
  /usr/lib/python3.10/site-packages/django/db/models/base.py:366: RuntimeWarning: Model 'authtoken.tokenproxy' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
auvipy commented 2 months ago

you are welcome to contribute the fix