]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #22390: Fix test_aifc to remove the created file
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Mar 2015 23:16:17 +0000 (01:16 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Mar 2015 23:16:17 +0000 (01:16 +0200)
Lib/test/test_aifc.py

index cfc491db21c2394fd467002b3c64a2b52f4a92a7..d4e9de595a4c7644a1ea45fc15b6bf39e4995b40 100644 (file)
@@ -322,12 +322,16 @@ class AIFCLowLevelTest(unittest.TestCase):
 
     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()