diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-06 22:26:57 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-06 22:26:57 (GMT) |
commit | fe4ef392d5df73639337f02db2ad8100d615067d (patch) | |
tree | a4da2e44c6b1a4e6457f73398b7f7c12746f437f | |
parent | bc27a050a7bef228c5e125c4de938faef56533fd (diff) | |
download | cpython-fe4ef392d5df73639337f02db2ad8100d615067d.zip cpython-fe4ef392d5df73639337f02db2ad8100d615067d.tar.gz cpython-fe4ef392d5df73639337f02db2ad8100d615067d.tar.bz2 |
Silence BytesWarning (backport 267a4d4d9d65).
-rw-r--r-- | Lib/test/test_exceptions.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index fe660bf..43fc7ee 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -8,8 +8,8 @@ import weakref import errno from test.support import (TESTFN, captured_output, check_impl_detail, - cpython_only, gc_collect, run_unittest, no_tracing, - unlink) + check_warnings, cpython_only, gc_collect, + no_tracing, run_unittest, unlink) class NaiveException(Exception): def __init__(self, x): @@ -960,9 +960,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(): |