MCPcopy Create free account
hub / github.com/python/cpython / test_uninitialized

Method test_uninitialized

Lib/test/test_io/test_bufferedio.py:1015–1027  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1013 self.assertFalse(pair.closed)
1014
1015 def test_uninitialized(self):
1016 pair = self.tp.__new__(self.tp)
1017 del pair
1018 pair = self.tp.__new__(self.tp)
1019 self.assertRaisesRegex((ValueError, AttributeError),
1020 'uninitialized|has no attribute',
1021 pair.read, 0)
1022 self.assertRaisesRegex((ValueError, AttributeError),
1023 'uninitialized|has no attribute',
1024 pair.write, b'')
1025 pair.__init__(self.MockRawIO(), self.MockRawIO())
1026 self.assertEqual(pair.read(0), b'')
1027 self.assertEqual(pair.write(b''), 0)
1028
1029 def test_detach(self):
1030 pair = self.tp(self.MockRawIO(), self.MockRawIO())

Callers

nothing calls this directly

Calls 6

assertRaisesRegexMethod · 0.80
__new__Method · 0.45
__init__Method · 0.45
assertEqualMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected