Skip to content

Commit

Permalink
plugin: add docstring to DjangoDbBlocker.restore()
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Sep 29, 2024
1 parent 1ff6679 commit 3fff7fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,11 @@ def block(self) -> ContextManager[None]:
return _DatabaseBlockerContextManager(self)

def restore(self) -> None:
"""Undo a previous call to block() or unblock().
Consider using block() and unblock() as context managers instead of
manually calling restore().
"""
self._dj_db_wrapper.ensure_connection = self._history.pop()


Expand Down

0 comments on commit 3fff7fc

Please sign in to comment.