diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-08 15:47:45 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-08 15:47:45 -0400 |
commit | bd632f8f58a25be4d1500ddd882c9cd5645748a9 (patch) | |
tree | 47710de6e63e2560ee69bdd22ba2de171b5463ed | |
parent | fda9a46afb56ce3d9d4f403a3f0d85b2899ebace (diff) | |
download | python-coveragepy-bd632f8f58a25be4d1500ddd882c9cd5645748a9.tar.gz |
Make the should_trace_cache test a little more bullet-proof.
-rw-r--r-- | tests/test_collector.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_collector.py b/tests/test_collector.py index d0aa997..29c3999 100644 --- a/tests/test_collector.py +++ b/tests/test_collector.py @@ -43,5 +43,12 @@ class CollectorTest(CoverageTest): # Grab all the filenames mentioned in debug output, there should be no # duplicates. - filenames = re.findall(r"'[^']+'", debug_out.getvalue()) + trace_lines = [ + l for l in debug_out.getvalue().splitlines() + if l.startswith("Tracing ") or l.startswith("Not tracing ") + ] + filenames = [re.search(r"'[^']+'", l).group() for l in trace_lines] self.assertEqual(len(filenames), len(set(filenames))) + + # Double-check that the tracing messages are in there somewhere. + self.assertTrue(len(filenames) > 5) |