diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-18 23:31:33 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-18 23:31:33 +0000 |
commit | 607bff1ebe81e869697e228322da4c308e8753a5 (patch) | |
tree | ab9126adaba09e9c1cd436b1ca76c5ac3d67eb3c /Lib/test/test_profile.py | |
parent | 6f34109384f3a78d5f4f8bdd418a89caca19631e (diff) | |
download | cpython-git-607bff1ebe81e869697e228322da4c308e8753a5.tar.gz |
Some tests did not pass on repeated calls (regrtest -R::)
Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
Diffstat (limited to 'Lib/test/test_profile.py')
-rwxr-xr-x | Lib/test/test_profile.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py index c8281c3436..0bd2530cf2 100755 --- a/Lib/test/test_profile.py +++ b/Lib/test/test_profile.py @@ -21,8 +21,9 @@ class ProfileTest(unittest.TestCase): def do_profiling(cls): results = [] prof = cls.profilerclass(timer, 0.001) + start_timer = timer() prof.runctx("testfunc()", globals(), locals()) - results.append(timer()) + results.append(timer() - start_timer) for methodname in cls.methodnames: s = StringIO() stats = pstats.Stats(prof, stream=s) @@ -33,7 +34,7 @@ class ProfileTest(unittest.TestCase): def test_cprofile(self): results = self.do_profiling() - self.assertEqual(results[0], 43000) + self.assertEqual(results[0], 1000) for i, method in enumerate(self.methodnames): self.assertEqual(results[i+1], self.expected_output[method], "Stats.%s output for %s doesn't fit expectation!" % |