summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2012-10-04 10:37:56 (GMT)
committerJesus Cea <jcea@jcea.es>2012-10-04 10:37:56 (GMT)
commitdc469454ec997166aea062f5727a8d59bab2f7a0 (patch)
treed8f0d7ff0a05298ad7c79314eab6e06e964099a6 /Lib
parent279ed3cc55e786c96c11aa9f224c507de5024099 (diff)
downloadcpython-dc469454ec997166aea062f5727a8d59bab2f7a0.zip
cpython-dc469454ec997166aea062f5727a8d59bab2f7a0.tar.gz
cpython-dc469454ec997166aea062f5727a8d59bab2f7a0.tar.bz2
Closes #15488: Closed files keep their buffer alive
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_io.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index d5eec7c..ec0501e 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -815,6 +815,14 @@ class SizeofTest:
bufio = self.tp(rawio, buffer_size=bufsize2)
self.assertEqual(sys.getsizeof(bufio), size + bufsize2)
+ @support.cpython_only
+ def test_buffer_freeing(self) :
+ bufsize = 4096
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio, buffer_size=bufsize)
+ size = sys.getsizeof(bufio) - bufsize
+ bufio.close()
+ self.assertEqual(sys.getsizeof(bufio), size)
class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
read_mode = "rb"