summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/test/testcases.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index c8f712d64b..6772370f09 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -222,10 +222,10 @@ class _AssertNumQueriesContext(object):
return self
def __exit__(self, exc_type, exc_value, traceback):
+ self.connection.use_debug_cursor = self.old_debug_cursor
if exc_type is not None:
return
- self.connection.use_debug_cursor = self.old_debug_cursor
final_queries = len(self.connection.queries)
executed = final_queries - self.starting_queries