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

Method test_initialization

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

Source from the content-addressed store, hash-verified

1449 shutdown_error = "LookupError: unknown encoding: ascii"
1450
1451 def test_initialization(self):
1452 r = self.BytesIO(b"\xc3\xa9\n\n")
1453 b = self.BufferedReader(r, 1000)
1454 t = self.TextIOWrapper(b, encoding="utf-8")
1455 self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy')
1456 self.assertRaises(ValueError, t.read)
1457
1458 t = self.TextIOWrapper.__new__(self.TextIOWrapper)
1459 self.assertRaises(Exception, repr, t)
1460
1461 def test_garbage_collection(self):
1462 # C TextIOWrapper objects are collected, and collecting them flushes

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.45
__new__Method · 0.45

Tested by

no test coverage detected