summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 198cc5d..a0a4670 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -602,6 +602,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
@@ -829,6 +830,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()
@@ -2731,6 +2733,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_close_error_on_close(self):
buffer = self.BytesIO(self.testdata)