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
This commit is contained in:
Alex Gaynor 2010-10-21 17:36:38 +00:00
parent 5864834fa5
commit 9d5d757bda
1 changed files with 1 additions and 1 deletions

View File

@ -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