MCPcopy Index your code
hub / github.com/python/cpython / test_uninitialized

Method test_uninitialized

Lib/test/test_io/test_textio.py:222–231  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 t.__init__(b, encoding="utf-8", newline='xyzzy')
221
222 def test_uninitialized(self):
223 t = self.TextIOWrapper.__new__(self.TextIOWrapper)
224 del t
225 t = self.TextIOWrapper.__new__(self.TextIOWrapper)
226 self.assertRaises(Exception, repr, t)
227 self.assertRaisesRegex((ValueError, AttributeError),
228 'uninitialized|has no attribute',
229 t.read, 0)
230 t.__init__(self.MockRawIO(), encoding="utf-8")
231 self.assertEqual(t.read(0), '')
232
233 def test_non_text_encoding_codecs_are_rejected(self):
234 # Ensure the constructor complains if passed a codec that isn't

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected