[Python-checkins] cpython: #17312: unlink a file that test_aifc was leaving around.

ezio.melotti python-checkins at python.org
Fri Mar 1 20:10:46 CET 2013


http://hg.python.org/cpython/rev/10909360a11d
changeset:   82445:10909360a11d
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Fri Mar 01 21:10:26 2013 +0200
summary:
  #17312: unlink a file that test_aifc was leaving around.

files:
  Lib/test/test_aifc.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py
--- a/Lib/test/test_aifc.py
+++ b/Lib/test/test_aifc.py
@@ -331,12 +331,14 @@
 
     def test_write_aiff_by_extension(self):
         sampwidth = 2
-        fout = self.fout = aifc.open(TESTFN + '.aiff', 'wb')
+        filename = TESTFN + '.aiff'
+        fout = self.fout = aifc.open(filename, 'wb')
+        self.addCleanup(unlink, filename)
         fout.setparams((1, sampwidth, 1, 1, b'ULAW', b''))
         frames = b'\x00' * fout.getnchannels() * sampwidth
         fout.writeframes(frames)
         fout.close()
-        f = self.f = aifc.open(TESTFN + '.aiff', 'rb')
+        f = self.f = aifc.open(filename, 'rb')
         self.assertEqual(f.getcomptype(), b'NONE')
         f.close()
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list