diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-08-27 10:10:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-27 10:10:36 (GMT) |
commit | b44a1d4f71daf4edb948b9878f82a60891e4a2e1 (patch) | |
tree | db454ee8236d5f40eaf6c0b29fe5b2e8d6584f8f | |
parent | 393f1ff62e032f20adaed2613a9e2d2d6bcb1eb3 (diff) | |
download | cpython-b44a1d4f71daf4edb948b9878f82a60891e4a2e1.zip cpython-b44a1d4f71daf4edb948b9878f82a60891e4a2e1.tar.gz cpython-b44a1d4f71daf4edb948b9878f82a60891e4a2e1.tar.bz2 |
bpo-34171: Fix test_trace. (GH-8940)
Remove "trace.cover" left from previous test runs before testing
that it is no longer created.
-rw-r--r-- | Lib/test/test_trace.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py index 3b335ca..63f4741 100644 --- a/Lib/test/test_trace.py +++ b/Lib/test/test_trace.py @@ -385,13 +385,16 @@ class TestCoverageCommandLineOutput(unittest.TestCase): unlink(self.coverfile) def test_cover_files_written_no_highlight(self): + # Test also that the cover file for the trace module is not created + # (issue #34171). + tracedir = os.path.dirname(os.path.abspath(trace.__file__)) + tracecoverpath = os.path.join(tracedir, 'trace.cover') + unlink(tracecoverpath) + argv = '-m trace --count'.split() + [self.codefile] status, stdout, stderr = assert_python_ok(*argv) self.assertEqual(stderr, b'') - tracedir = os.path.dirname(os.path.abspath(trace.__file__)) - tracecoverpath = os.path.join(tracedir, "trace.cover") self.assertFalse(os.path.exists(tracecoverpath)) - self.assertTrue(os.path.exists(self.coverfile)) with open(self.coverfile) as f: self.assertEqual(f.read(), |