summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_trace.py')
-rw-r--r--Lib/test/test_trace.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py
index 33d7aa1..9c018b7 100644
--- a/Lib/test/test_trace.py
+++ b/Lib/test/test_trace.py
@@ -334,6 +334,20 @@ class TestCoverage(unittest.TestCase):
self.assertIn(modname, coverage)
self.assertEqual(coverage[modname], (5, 100))
+### Tests that don't mess with sys.settrace and can be traced
+### themselves TODO: Skip tests that do mess with sys.settrace when
+### regrtest is invoked with -T option.
+class Test_Ignore(unittest.TestCase):
+ def test_ignored(self):
+ ignore = trace.Ignore(['x', 'y.z'], ['/foo/bar'])
+ self.assertTrue(ignore.names('x.py', 'x'))
+ self.assertFalse(ignore.names('xy.py', 'xy'))
+ self.assertFalse(ignore.names('y.py', 'y'))
+ self.assertTrue(ignore.names('/foo/bar/baz.py', 'baz'))
+ self.assertFalse(ignore.names('bar/z.py', 'z'))
+ # Matched before.
+ self.assertTrue(ignore.names('bar/baz.py', 'baz'))
+
def test_main():
run_unittest(__name__)