diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-09 20:38:15 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-09 20:38:15 (GMT) |
| commit | a4815caa7ccf21aa994d0e0eec66873072f0e352 (patch) | |
| tree | 5ccb44937ddfdd59ebae4590d2f4cfc05dcced3d /Lib/test/test_io.py | |
| parent | a6c91f5e3b013be1447454b3a479d6fabbf16806 (diff) | |
| download | cpython-a4815caa7ccf21aa994d0e0eec66873072f0e352.zip cpython-a4815caa7ccf21aa994d0e0eec66873072f0e352.tar.gz cpython-a4815caa7ccf21aa994d0e0eec66873072f0e352.tar.bz2 | |
Issue #10872: The repr() of TextIOWrapper objects now includes the mode
if available.
(at Georg's request)
Diffstat (limited to 'Lib/test/test_io.py')
| -rw-r--r-- | Lib/test/test_io.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index ee4e42f..a25d9af 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1717,9 +1717,12 @@ class TextIOWrapperTest(unittest.TestCase): raw.name = "dummy" self.assertEqual(repr(t), "<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname) + t.mode = "r" + self.assertEqual(repr(t), + "<%s.TextIOWrapper name='dummy' mode='r' encoding='utf-8'>" % modname) raw.name = b"dummy" self.assertEqual(repr(t), - "<%s.TextIOWrapper name=b'dummy' encoding='utf-8'>" % modname) + "<%s.TextIOWrapper name=b'dummy' mode='r' encoding='utf-8'>" % modname) def test_line_buffering(self): r = self.BytesIO() |
