Commit e76e23e1 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Broke reference loops in tests added in issue #5700.

parent 7d96270d
......@@ -577,6 +577,7 @@ class IOTest(unittest.TestCase):
self.assertTrue(f.closed)
self.assertTrue(closed) # flush() called
self.assertFalse(closed[0]) # flush() called before file closed
f.flush = lambda: None # break reference loop
def test_flush_error_on_close(self):
# raw file
......@@ -786,6 +787,7 @@ class CommonBufferedTests:
self.assertTrue(closed) # flush() called
self.assertFalse(closed[0]) # flush() called before file closed
self.assertFalse(closed[1])
raw.flush = lambda: None # break reference loop
def test_close_error_on_close(self):
raw = self.MockRawIO()
......@@ -2536,6 +2538,7 @@ class TextIOWrapperTest(unittest.TestCase):
self.assertTrue(closed) # flush() called
self.assertFalse(closed[0]) # flush() called before file closed
self.assertFalse(closed[1])
txt.flush = lambda: None # break reference loop
def test_multi_close(self):
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment