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

Method test_issue142594

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

Source from the content-addressed store, hash-verified

1545 buf._write_stack)
1546
1547 def test_issue142594(self):
1548 wrapper = None
1549 detached = False
1550 class ReentrantRawIO(self.RawIOBase):
1551 @property
1552 def closed(self):
1553 nonlocal detached
1554 if wrapper is not None and not detached:
1555 detached = True
1556 wrapper.detach()
1557 return False
1558
1559 raw = ReentrantRawIO()
1560 wrapper = self.TextIOWrapper(raw)
1561 wrapper.close() # should not crash
1562
1563
1564class PyTextIOWrapperTest(TextIOWrapperTest, PyTestCase):

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
ReentrantRawIOClass · 0.85

Tested by

no test coverage detected