summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-11-09 12:50:28 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-11-09 12:50:28 -0500
commit06dfb9333436913cb93ae5fac55c171af78eac94 (patch)
tree313d1db8b966e6d20f0c51f3f7eb206097f35b73 /perf
parentc77a0db995121baf6d3c281e9c902d4119a2c968 (diff)
downloadpython-coveragepy-06dfb9333436913cb93ae5fac55c171af78eac94.tar.gz
Clean the file imports using a helper
Diffstat (limited to 'perf')
-rw-r--r--perf/stress_test.py7
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()