From 01eaf500fc4e3e3ab5a34ab7578cf8470e1354fb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 30 Mar 2015 01:16:17 +0200 Subject: [PATCH] Issue #22390: Fix test_aifc to remove the created file --- Lib/test/test_aifc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py index cfc491db21c..d4e9de595a4 100644 --- a/Lib/test/test_aifc.py +++ b/Lib/test/test_aifc.py @@ -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()