mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #15204: Silence and check the 'U' mode deprecation warnings in tests.
Changed deprecation message in the fileinput module.
This commit is contained in:
parent
ed8c906127
commit
2480c2ed59
5 changed files with 33 additions and 13 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue