diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-11-09 12:50:28 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-11-09 12:50:28 -0500 |
commit | 06dfb9333436913cb93ae5fac55c171af78eac94 (patch) | |
tree | 313d1db8b966e6d20f0c51f3f7eb206097f35b73 /perf | |
parent | c77a0db995121baf6d3c281e9c902d4119a2c968 (diff) | |
download | python-coveragepy-06dfb9333436913cb93ae5fac55c171af78eac94.tar.gz |
Clean the file imports using a helper
Diffstat (limited to 'perf')
-rw-r--r-- | perf/stress_test.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/perf/stress_test.py b/perf/stress_test.py index d1ee196..f41f9f1 100644 --- a/perf/stress_test.py +++ b/perf/stress_test.py @@ -35,10 +35,11 @@ def mk_main(file_count, call_count, line_count): return "\n".join(lines) - class StressTest(CoverageTest): def _compute_overhead(self, file_count, call_count, line_count): + self.clean_local_file_imports() + for idx in range(file_count): self.make_file('test{}.py'.format(idx), TEST_FILE) self.make_file('testmain.py', mk_main(file_count, call_count, line_count)) @@ -47,9 +48,7 @@ class StressTest(CoverageTest): self.import_local_file("testmain", None) baseline = time.perf_counter() - start - del sys.modules['testmain'] - for idx in range(file_count): - del sys.modules['test{}'.format(idx)] + self.clean_local_file_imports() start = time.perf_counter() cov = coverage.Coverage() |