Kaydet (Commit) 4528bcde authored tarafından Antoine Pitrou's avatar Antoine Pitrou

The test for #5330 wasn't correct.

üst 46dbe27f
...@@ -44,7 +44,6 @@ class ProfileTest(unittest.TestCase): ...@@ -44,7 +44,6 @@ class ProfileTest(unittest.TestCase):
def test_calling_conventions(self): def test_calling_conventions(self):
# Issue #5330: profile and cProfile wouldn't report C functions called # Issue #5330: profile and cProfile wouldn't report C functions called
# with keyword arguments. We test all calling conventions. # with keyword arguments. We test all calling conventions.
prof = self.profilerclass(timer, 0.001)
stmts = [ stmts = [
"[].sort()", "[].sort()",
"[].sort(reverse=True)", "[].sort(reverse=True)",
...@@ -53,6 +52,7 @@ class ProfileTest(unittest.TestCase): ...@@ -53,6 +52,7 @@ class ProfileTest(unittest.TestCase):
] ]
for stmt in stmts: for stmt in stmts:
s = StringIO() s = StringIO()
prof = self.profilerclass(timer, 0.001)
prof.runctx(stmt, globals(), locals()) prof.runctx(stmt, globals(), locals())
stats = pstats.Stats(prof, stream=s) stats = pstats.Stats(prof, stream=s)
stats.print_stats() stats.print_stats()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment