From 3fff7fcdef1cf1d20f7f7da1fdeda046f2843298 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 28 Sep 2024 22:01:31 +0300 Subject: [PATCH] plugin: add docstring to DjangoDbBlocker.restore() --- pytest_django/plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index 8af5c1e0..669e7841 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -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()