add a __dict__ descr for IOBase (closes #12878)

This commit is contained in:
Benjamin Peterson 2011-09-03 09:26:20 -04:00
parent 7335e6f3e8
commit f6f3a35447
3 changed files with 27 additions and 0 deletions

View file

@ -610,6 +610,17 @@ class IOTest(unittest.TestCase):
self.assertEqual(rawio.read(2), None)
self.assertEqual(rawio.read(2), b"")
def test_types_have_dict(self):
test = (
self.IOBase(),
self.RawIOBase(),
self.TextIOBase(),
self.StringIO(),
self.BytesIO()
)
for obj in test:
self.assertTrue(hasattr(obj, "__dict__"))
class CIOTest(IOTest):
def test_IOBase_finalize(self):