mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
SF patch #1359365: cStringIO.StringIO.isatty() will raise a ValueError
now if close() has been called before (like file and StringIO.StringIO do)
This commit is contained in:
parent
9998f78d6d
commit
197e8321c6
3 changed files with 12 additions and 1 deletions
|
@ -75,6 +75,13 @@ class TestGenericStringIO(unittest.TestCase):
|
|||
f.close()
|
||||
self.assertEqual(f.closed, True)
|
||||
|
||||
def test_isatty(self):
|
||||
f = self.MODULE.StringIO()
|
||||
self.assertRaises(TypeError, f.isatty, None)
|
||||
self.assertEqual(f.isatty(), False)
|
||||
f.close()
|
||||
self.assertRaises(ValueError, f.isatty)
|
||||
|
||||
def test_iterator(self):
|
||||
eq = self.assertEqual
|
||||
unless = self.failUnless
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue