Issue #15204: Silence and check the 'U' mode deprecation warnings in tests.

Changed deprecation message in the fileinput module.
This commit is contained in:
Serhiy Storchaka 2013-11-24 23:13:26 +02:00
parent ed8c906127
commit 2480c2ed59
5 changed files with 33 additions and 13 deletions

View file

@ -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):