summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-03-11 14:15:17 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-03-11 14:15:17 -0500
commitbd3db4260db017b6216450e12e0c8410b61a9c51 (patch)
tree73df006cad2d37d200d03b52e9504580a7d14caf /tests/test_api.py
parent3ebdde3ae5bbac6744a8c71092bd56caa47c007f (diff)
downloadpython-coveragepy-bd3db4260db017b6216450e12e0c8410b61a9c51.tar.gz
Cleanly stop coverage objects, for metacov
Without these cov.stop() calls, the collector stack is wrong when doing meta-coverage.
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 07f5506..3310824 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -299,6 +299,8 @@ class ApiTest(CoverageTest):
cov.save()
import_local_file("code2")
self.check_code1_code2(cov)
+ # Then stop it, or the test suite gets out of whack.
+ cov.stop()
def test_two_getdata_only_warn_once(self):
self.make_code1_code2()
@@ -326,6 +328,8 @@ class ApiTest(CoverageTest):
# won't make another warning.
with self.assert_warnings(cov, []):
cov.get_data()
+ # Then stop it, or the test suite gets out of whack.
+ cov.stop()
def test_two_getdata_warn_twice(self):
self.make_code1_code2()
@@ -339,6 +343,8 @@ class ApiTest(CoverageTest):
# Calling get_data a second time after tracing some more will warn again.
with self.assert_warnings(cov, ["No data was collected"]):
cov.get_data()
+ # Then stop it, or the test suite gets out of whack.
+ cov.stop()
def make_good_data_files(self):
"""Make some good data files."""