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

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

Open
6 tasks
wuch-g2v opened this issue Jun 1, 2024 · 1 comment

Comments

@wuch-g2v
Copy link

wuch-g2v commented Jun 1, 2024

Checklist

  • Raised initially as discussion #...
  • This is not a feature request suitable for implementation outside this project. Please elaborate what it is:
    • compatibility fix for new Django/Python version ...
    • other type of bug fix
    • other type of improvement that does not touch existing code or change existing behavior (e.g. wrapper for new Django field)
  • I have reduced the issue to the simplest possible case.

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
Copy link
Member

auvipy commented Jul 15, 2024

you are welcome to contribute the fix

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

No branches or pull requests

2 participants