diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-09 14:23:38 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-09 14:23:38 -0400 |
commit | fb2c6262c4964eba2d90a1ddd999fe5bc49827b4 (patch) | |
tree | 570cd77b933bcbb83d4fe20fd87ba660519d3bbe /tests/test_plugins.py | |
parent | e16eb5245857db6574a0c0fdcf76879708a316c4 (diff) | |
download | python-coveragepy-git-nedbat/close-data.tar.gz |
Make Analysis a context manager to properly close sqlite filesnedbat/close-data
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r-- | tests/test_plugins.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index a4c7a5ee..9afe83da 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -399,13 +399,12 @@ class GoodFileTracerTest(FileTracerTest): # The way plugin2 works, a file named foo_7.html will be claimed to # have 7 lines in it. If render() was called with line number 4, # then the plugin will claim that lines 4 and 5 were executed. - analysis = cov._analyze("foo_7.html") - self.assertEqual(analysis.statements, set([1, 2, 3, 4, 5, 6, 7])) - # Plugins don't do branch coverage yet. - self.assertEqual(analysis.has_arcs(), True) - self.assertEqual(analysis.arc_possibilities(), []) - - self.assertEqual(analysis.missing, set([1, 2, 3, 6, 7])) + with cov._analyze("foo_7.html") as analysis: + self.assertEqual(analysis.statements, set([1, 2, 3, 4, 5, 6, 7])) + # Plugins don't do branch coverage yet. + self.assertEqual(analysis.has_arcs(), True) + self.assertEqual(analysis.arc_possibilities(), []) + self.assertEqual(analysis.missing, set([1, 2, 3, 6, 7])) def test_plugin2_with_text_report(self): self.make_render_and_caller() |