MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_initialization

Method test_initialization

Lib/test/test_io.py:4117–4125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4115 return super().test_read_non_blocking()
4116
4117 def test_initialization(self):
4118 r = self.BytesIO(b"\xc3\xa9\n\n")
4119 b = self.BufferedReader(r, 1000)
4120 t = self.TextIOWrapper(b, encoding="utf-8")
4121 self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy')
4122 self.assertRaises(ValueError, t.read)
4123
4124 t = self.TextIOWrapper.__new__(self.TextIOWrapper)
4125 self.assertRaises(Exception, repr, t)
4126
4127 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: filter ('', ResourceWarning) did not catch any warning
4128 @unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; cyclic GC not supported, causes file locking")

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.45
__new__Method · 0.45

Tested by

no test coverage detected