summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport_support.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2011-02-21 19:29:56 (GMT)
committerBrett Cannon <bcannon@gmail.com>2011-02-21 19:29:56 (GMT)
commit31f5929c1e28adcaa1fdb302da366f3c7a92a98a (patch)
tree5035df0c8c20111fb27a4940e38401f244bc9854 /Lib/test/test_zipimport_support.py
parent4709ec0686ba85466a293b85a243979882696240 (diff)
downloadcpython-31f5929c1e28adcaa1fdb302da366f3c7a92a98a.zip
cpython-31f5929c1e28adcaa1fdb302da366f3c7a92a98a.tar.gz
cpython-31f5929c1e28adcaa1fdb302da366f3c7a92a98a.tar.bz2
Issue #10990: Prevent tests from clobbering a set trace function.
Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.
Diffstat (limited to 'Lib/test/test_zipimport_support.py')
-rw-r--r--Lib/test/test_zipimport_support.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index 610dfa0..e3dd3e9 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -163,20 +163,24 @@ class ZipSupportTests(unittest.TestCase):
test_zipped_doctest.test_DocTestRunner.verbose_flag,
test_zipped_doctest.test_Example,
test_zipped_doctest.test_debug,
- test_zipped_doctest.test_pdb_set_trace,
- test_zipped_doctest.test_pdb_set_trace_nested,
test_zipped_doctest.test_testsource,
test_zipped_doctest.test_trailing_space_in_test,
test_zipped_doctest.test_DocTestSuite,
test_zipped_doctest.test_DocTestFinder,
]
- # These remaining tests are the ones which need access
+ # These tests are the ones which need access
# to the data files, so we don't run them
fail_due_to_missing_data_files = [
test_zipped_doctest.test_DocFileSuite,
test_zipped_doctest.test_testfile,
test_zipped_doctest.test_unittest_reportflags,
]
+ # These tests are skipped when a trace funciton is set
+ can_fail_due_to_tracing = [
+ test_zipped_doctest.test_pdb_set_trace,
+ test_zipped_doctest.test_pdb_set_trace_nested,
+ ]
+
for obj in known_good_tests:
_run_object_doctest(obj, test_zipped_doctest)
finally: