diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-24 21:13:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-24 21:13:26 (GMT) |
commit | 2480c2ed593a164fe3a4821a13d5867a0a7102ed (patch) | |
tree | e33efad894bf91e221465d7ce251531ea01d6319 /Lib/test/test_codecs.py | |
parent | ed8c9061270b619de1d603ac34502b41cc84822f (diff) | |
download | cpython-2480c2ed593a164fe3a4821a13d5867a0a7102ed.zip cpython-2480c2ed593a164fe3a4821a13d5867a0a7102ed.tar.gz cpython-2480c2ed593a164fe3a4821a13d5867a0a7102ed.tar.bz2 |
Issue #15204: Silence and check the 'U' mode deprecation warnings in tests.
Changed deprecation message in the fileinput module.
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r-- | Lib/test/test_codecs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 639ce9f..f682380 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -602,7 +602,9 @@ class UTF16Test(ReadTest, unittest.TestCase): self.addCleanup(support.unlink, support.TESTFN) with open(support.TESTFN, 'wb') as fp: fp.write(s) - with codecs.open(support.TESTFN, 'U', encoding=self.encoding) as reader: + with support.check_warnings(('', DeprecationWarning)): + reader = codecs.open(support.TESTFN, 'U', encoding=self.encoding) + with reader: self.assertEqual(reader.read(), s1) class UTF16LETest(ReadTest, unittest.TestCase): |