summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport_support.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-31 22:01:03 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-31 22:01:03 (GMT)
commit6257a7bbb2660ae75c44f2e71d7ac2ce73900f74 (patch)
tree6f010065c95f2d5617f56e07ba2628be21cf9d7a /Lib/test/test_zipimport_support.py
parentad5983364966b49c277b495112ae41c6ae2d01ed (diff)
downloadcpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.zip
cpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.tar.gz
cpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.tar.bz2
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
Diffstat (limited to 'Lib/test/test_zipimport_support.py')
-rw-r--r--Lib/test/test_zipimport_support.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index 960f3c3..4f41518 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -168,12 +168,14 @@ class ZipSupportTests(ImportHooksBaseTestCase):
test_zipped_doctest.test_unittest_reportflags,
]
# Needed for test_DocTestParser and test_debug
- with test.test_support.check_py3k_warnings(
- ("backquote not supported", SyntaxWarning),
- ("execfile.. not supported", DeprecationWarning)):
+ deprecations = [
# Ignore all warnings about the use of class Tester in this module.
- warnings.filterwarnings("ignore", "class Tester is deprecated",
- DeprecationWarning)
+ ("class Tester is deprecated", DeprecationWarning)]
+ if sys.py3kwarning:
+ deprecations += [
+ ("backquote not supported", SyntaxWarning),
+ ("execfile.. not supported", DeprecationWarning)]
+ with test.test_support.check_warnings(*deprecations):
for obj in known_good_tests:
_run_object_doctest(obj, test_zipped_doctest)