Skip to content

Commit 740ab35

Browse files
committed
plugin: unconfigure should restore not unblock
`restore` pops the `block` in `_setup_django`, while `unblock` pushes an unblock. We want to leave things clean, so should `restore`.
1 parent 259fb85 commit 740ab35

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pytest_django/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,10 @@ def get_order_number(test: pytest.Item) -> int:
477477

478478

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

485485

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

0 commit comments

Comments
 (0)