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 | 81230388f1bd49f103856c7cfdb9e374c9a95a90 (patch) | |
tree | b92ea41b029406feb6d5792f121f3e090d6df3fb /perf/stress_test.py | |
parent | f985828da35afd7e42a5bd813946537c24af4ca5 (diff) | |
download | python-coveragepy-git-81230388f1bd49f103856c7cfdb9e374c9a95a90.tar.gz |
Clean the file imports using a helper
Diffstat (limited to 'perf/stress_test.py')
-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 d1ee196b..f41f9f1e 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() |