[pypy-commit] pypy default: Sorry, fix this test. It comes from f9a24c80bd03.

arigo noreply at buildbot.pypy.org
Fri Jul 15 13:38:37 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45618:9aebf8933ec2
Date: 2011-07-15 13:38 +0200
http://bitbucket.org/pypy/pypy/changeset/9aebf8933ec2/

Log:	Sorry, fix this test. It comes from f9a24c80bd03.

diff --git a/pypy/module/bz2/test/test_bz2_file.py b/pypy/module/bz2/test/test_bz2_file.py
--- a/pypy/module/bz2/test/test_bz2_file.py
+++ b/pypy/module/bz2/test/test_bz2_file.py
@@ -133,6 +133,7 @@
         
         bz2f.seek(0)
         assert bz2f.tell() == 0
+        del bz2f   # delete from this frame, which is captured in the traceback
 
     def test_open_close_del(self):
         from bz2 import BZ2File
@@ -246,11 +247,18 @@
         assert text_read == self.TEXT
         bz2f.close()
 
+    def test_silently_closes(self):
+        from bz2 import BZ2File
+        self.create_broken_temp_file()
+        BZ2File(self.temppath)
+        # check that no C-level malloc is left behind
+
     def test_read_broken_file(self):
         from bz2 import BZ2File
         self.create_broken_temp_file()
         bz2f = BZ2File(self.temppath)
         raises(EOFError, bz2f.read)
+        del bz2f   # delete from this frame, which is captured in the traceback
 
     def test_subsequent_read_broken_file(self):
         from bz2 import BZ2File
@@ -264,6 +272,7 @@
                 raise Exception("should generate EOFError earlier")
         except EOFError:
             pass
+        del bz2f   # delete from this frame, which is captured in the traceback
 
     def test_read_chunk10(self):
         from bz2 import BZ2File
@@ -416,6 +425,7 @@
         bz2f.close()
         bz2f = BZ2File(self.temppath, 'r')
         assert bz2f.read() == self.random_data
+        del bz2f   # delete from this frame, which is captured in the traceback
 
     def test_context_manager(self):
         from bz2 import BZ2File


More information about the pypy-commit mailing list