]> granicus.if.org Git - python/commitdiff
#17312: unlink a file that test_aifc was leaving around.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 1 Mar 2013 19:10:26 +0000 (21:10 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 1 Mar 2013 19:10:26 +0000 (21:10 +0200)
Lib/test/test_aifc.py

index 34589f24c181331956eeafe43c4530bd4430cc53..98d43e42c08844ff680452d74280d291fe1c59e7 100644 (file)
@@ -331,12 +331,14 @@ class AIFCLowLevelTest(unittest.TestCase):
 
     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()