From 9d5d757bda5b83e9867ea695f1dd2ccde9aed1ed Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 21 Oct 2010 17:36:38 +0000 Subject: [PATCH] Fixed #14520 -- fixed a memory leak when running the test suite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14312 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/test/testcases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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