summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-16 00:38:21 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-16 00:38:21 (GMT)
commitca01a768781ba5cdf768858efaabaf7759163af5 (patch)
tree002097d4bcca8dba3e084a5ee31961aac6d2f027
parentd7d9a44226560e411467a1156be3a8c456cd9832 (diff)
downloadcpython-ca01a768781ba5cdf768858efaabaf7759163af5.zip
cpython-ca01a768781ba5cdf768858efaabaf7759163af5.tar.gz
cpython-ca01a768781ba5cdf768858efaabaf7759163af5.tar.bz2
don't expect warnings from doctests if they can't run
-rw-r--r--Lib/test/test_doctest.py4
-rw-r--r--Lib/test/test_zipimport_support.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 8c87bee..45057c8 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -2673,7 +2673,9 @@ def test_main():
from test import test_doctest
# Ignore all warnings about the use of class Tester in this module.
- deprecations = [("class Tester is deprecated", DeprecationWarning)]
+ deprecations = []
+ if __debug__:
+ deprecations.append(("class Tester is deprecated", DeprecationWarning))
if sys.py3kwarning:
deprecations += [("backquote not supported", SyntaxWarning),
("execfile.. not supported", DeprecationWarning)]
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index 199cf20..704f35c 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -179,9 +179,10 @@ class ZipSupportTests(ImportHooksBaseTestCase):
test_zipped_doctest.test_unittest_reportflags,
]
# Needed for test_DocTestParser and test_debug
- deprecations = [
+ deprecations = []
+ if __debug__:
# Ignore all warnings about the use of class Tester in this module.
- ("class Tester is deprecated", DeprecationWarning)]
+ depcreations.append(("class Tester is deprecated", DeprecationWarning))
if sys.py3kwarning:
deprecations += [
("backquote not supported", SyntaxWarning),