Skip to content

Commit

Permalink
plugin: unconfigure should restore not unblock
Browse files Browse the repository at this point in the history
`restore` pops the `block` in `_setup_django`, while `unblock` pushes an
unblock. We want to leave things clean, so should `restore`.
  • Loading branch information
bluetech committed Sep 28, 2024
1 parent 259fb85 commit 740ab35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ def get_order_number(test: pytest.Item) -> int:


def pytest_unconfigure(config: pytest.Config) -> None:
if blocking_manager_key not in config.stash:
return
blocking_manager = config.stash[blocking_manager_key]
blocking_manager.unblock()
# Undo the block() in _setup_django().
if blocking_manager_key in config.stash:
blocking_manager = config.stash[blocking_manager_key]
blocking_manager.restore()


@pytest.fixture(autouse=True, scope="session")
Expand Down

0 comments on commit 740ab35

Please sign in to comment.