summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-07-07 07:40:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-07-07 13:39:13 -0400
commitdade9db58673d4f712ba5c50ed66d1c67a7e1d5d (patch)
tree1b88b3f99bd3348b566d01943439ccb72b4673ca /tests/test_api.py
parent4b43eff1377e818db2c42521d98bf2a0973b1cb6 (diff)
downloadpython-coveragepy-git-dade9db58673d4f712ba5c50ed66d1c67a7e1d5d.tar.gz
Avoid useless or redundant db operations. Faster.
Moving operations into the "with self._connect" means less opening and closing of the database. Returning early if there is no data to write avoids writing empty contexts.
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 920cd9ad..301257dc 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -326,21 +326,6 @@ class ApiTest(CoverageTest):
with self.assert_warnings(cov, []):
cov.get_data()
- def test_two_getdata_only_warn_once_nostop(self):
- self.make_code1_code2()
- cov = coverage.Coverage(source=["."], omit=["code1.py"])
- cov.start()
- import_local_file("code1") # pragma: nested
- # We didn't collect any data, so we should get a warning.
- with self.assert_warnings(cov, ["No data was collected"]): # pragma: nested
- cov.get_data() # pragma: nested
- # But calling get_data a second time with no intervening activity
- # won't make another warning.
- with self.assert_warnings(cov, []): # pragma: nested
- cov.get_data() # pragma: nested
- # Then stop it, or the test suite gets out of whack.
- cov.stop() # pragma: nested
-
def test_two_getdata_warn_twice(self):
self.make_code1_code2()
cov = coverage.Coverage(source=["."], omit=["code1.py", "code2.py"])