summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-07-09 14:23:38 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-07-09 14:23:38 -0400
commitfb2c6262c4964eba2d90a1ddd999fe5bc49827b4 (patch)
tree570cd77b933bcbb83d4fe20fd87ba660519d3bbe /tests/test_api.py
parente16eb5245857db6574a0c0fdcf76879708a316c4 (diff)
downloadpython-coveragepy-git-nedbat/close-data.tar.gz
Make Analysis a context manager to properly close sqlite filesnedbat/close-data
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 301257dc..c69a3010 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -834,7 +834,8 @@ class AnalysisTest(CoverageTest):
# Import the Python file, executing it.
self.start_import_stop(cov, "missing")
- nums = cov._analyze("missing.py").numbers
+ with cov._analyze("missing.py") as analysis:
+ nums = analysis.numbers
self.assertEqual(nums.n_files, 1)
self.assertEqual(nums.n_statements, 7)
self.assertEqual(nums.n_excluded, 1)