summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-10-13 23:42:32 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-10-13 23:42:32 (GMT)
commit6d70870812d9e07a76c09fa4cf12c1d4bd9b91e8 (patch)
treed2acbab7abeae5c4266b75d890b06b5acccb524d /Lib/test/test_exceptions.py
parentba3e4a0bc07b2bfead826216b46b9093facdbc6e (diff)
downloadcpython-6d70870812d9e07a76c09fa4cf12c1d4bd9b91e8.zip
cpython-6d70870812d9e07a76c09fa4cf12c1d4bd9b91e8.tar.gz
cpython-6d70870812d9e07a76c09fa4cf12c1d4bd9b91e8.tar.bz2
Clean up some warnings in test suite output.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 413f4dd..8e5a767 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -8,7 +8,7 @@ import weakref
import errno
from test.support import (TESTFN, unlink, run_unittest, captured_output,
- gc_collect, cpython_only, no_tracing)
+ check_warnings, gc_collect, cpython_only, no_tracing)
class NaiveException(Exception):
def __init__(self, x):
@@ -939,9 +939,10 @@ class ImportErrorTests(unittest.TestCase):
def test_non_str_argument(self):
# Issue #15778
- arg = b'abc'
- exc = ImportError(arg)
- self.assertEqual(str(arg), str(exc))
+ with check_warnings(('', BytesWarning), quiet=True):
+ arg = b'abc'
+ exc = ImportError(arg)
+ self.assertEqual(str(arg), str(exc))
def test_main():