[Python-checkins] cpython (2.7): Issue #22390: Fix test_aifc to remove the created file

victor.stinner python-checkins at python.org
Mon Mar 30 01:20:04 CEST 2015


https://hg.python.org/cpython/rev/fb5c3528d0d7
changeset: 95262:fb5c3528d0d7
branch: 2.7
parent: 95260:207db4338706
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Mar 30 01:16:17 2015 +0200
summary:
 Issue #22390: Fix test_aifc to remove the created file
files:
 Lib/test/test_aifc.py | 8 ++++++--
 1 files changed, 6 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
@@ -322,12 +322,16 @@
 
 def test_write_aiff_by_extension(self):
 sampwidth = 2
- fout = self.fout = aifc.open(TESTFN + '.aiff', 'wb')
+ filename = TESTFN + '.aiff'
+ self.addCleanup(unlink, filename)
+
+ fout = self.fout = aifc.open(filename, 'wb')
 fout.setparams((1, sampwidth, 1, 1, 'ULAW', ''))
 frames = '\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(), 'NONE')
 f.close()
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /