From 7b27f65dd9f25634d85c48bef72609112e101449 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 31 Dec 2012 08:37:04 -0500 Subject: Added a test while investigating bug #79. --- test/test_api.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test') diff --git a/test/test_api.py b/test/test_api.py index 1f351b4..f08e731 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -316,6 +316,25 @@ class ApiTest(CoverageTest): cov.erase() cov.report() + def test_start_stop_start_stop(self): + self.make_file("code1.py", """\ + code1 = 1 + """) + self.make_file("code2.py", """\ + code2 = 1 + code2 = 2 + """) + cov = coverage.coverage() + self.start_import_stop(cov, "code1") + cov.save() + self.start_import_stop(cov, "code2") + _, statements, missing, _ = cov.analysis("code1.py") + self.assertEqual(statements, [1]) + self.assertEqual(missing, []) + _, statements, missing, _ = cov.analysis("code2.py") + self.assertEqual(statements, [1, 2]) + self.assertEqual(missing, []) + class UsingModulesMixin(object): """A mixin for importing modules from test/modules and test/moremodules.""" -- cgit v1.2.1