summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-22 22:31:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-22 22:31:33 (GMT)
commit0f88891809b7619130b20494b1eb30fe400de6ce (patch)
tree00ad841f4512e9d2fb49e333705674915392a69c
parent06a13f81ea6293b9aa516a7b2f07f217f8cabb01 (diff)
parentc26a1a490fd290fb40bf00a8014834484aeafdd4 (diff)
downloadcpython-0f88891809b7619130b20494b1eb30fe400de6ce.zip
cpython-0f88891809b7619130b20494b1eb30fe400de6ce.tar.gz
cpython-0f88891809b7619130b20494b1eb30fe400de6ce.tar.bz2
Broke reference loops in tests added in issue #5700.
-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)