Skip to content

Commit

Permalink
Remove redundant _setup_django call in django_test_environment
Browse files Browse the repository at this point in the history
This was added in 61372a2, but that was
basically reverted in 0e01f05 so is no
longer necessary given the call in `pytest_configure`.
  • Loading branch information
bluetech committed Jan 29, 2024
1 parent 6cf63b6 commit d0d22ba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,7 @@ def get_order_number(test: pytest.Item) -> int:

@pytest.fixture(autouse=True, scope="session")
def django_test_environment(request: pytest.FixtureRequest) -> Generator[None, None, None]:
"""
Ensure that Django is loaded and has its testing environment setup.
"""Setup Django's test environment for the testing session.
XXX It is a little dodgy that this is an autouse fixture. Perhaps
an email fixture should be requested in order to be able to
Expand All @@ -481,7 +480,6 @@ def django_test_environment(request: pytest.FixtureRequest) -> Generator[None, N
we need to follow this model.
"""
if django_settings_is_configured():
_setup_django(request.config)
from django.test.utils import setup_test_environment, teardown_test_environment

debug_ini = request.config.getini("django_debug_mode")
Expand Down

0 comments on commit d0d22ba

Please sign in to comment.