summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-09-08 15:47:45 -0400
committerNed Batchelder <ned@nedbatchelder.com>2013-09-08 15:47:45 -0400
commitbd632f8f58a25be4d1500ddd882c9cd5645748a9 (patch)
tree47710de6e63e2560ee69bdd22ba2de171b5463ed
parentfda9a46afb56ce3d9d4f403a3f0d85b2899ebace (diff)
downloadpython-coveragepy-bd632f8f58a25be4d1500ddd882c9cd5645748a9.tar.gz
Make the should_trace_cache test a little more bullet-proof.
-rw-r--r--tests/test_collector.py9
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)