]> granicus.if.org Git - python/commitdiff
The test for #5330 wasn't correct.
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 May 2009 21:39:25 +0000 (21:39 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 May 2009 21:39:25 +0000 (21:39 +0000)
Lib/test/test_profile.py

index 421aa1b40426e8c9aa93db29ff16f06b535962de..0016d517f7dd596af2bbe156a2fc8fbde111b69d 100755 (executable)
@@ -44,7 +44,6 @@ class ProfileTest(unittest.TestCase):
     def test_calling_conventions(self):
         # Issue #5330: profile and cProfile wouldn't report C functions called
         # with keyword arguments. We test all calling conventions.
-        prof = self.profilerclass(timer, 0.001)
         stmts = [
             "[].sort()",
             "[].sort(reverse=True)",
@@ -53,6 +52,7 @@ class ProfileTest(unittest.TestCase):
         ]
         for stmt in stmts:
             s = StringIO()
+            prof = self.profilerclass(timer, 0.001)
             prof.runctx(stmt, globals(), locals())
             stats = pstats.Stats(prof, stream=s)
             stats.print_stats()