#17312: unlink a file that test_aifc was leaving around.

This commit is contained in:
Ezio Melotti 2013-03-01 21:10:26 +02:00
parent dc99e0d396
commit 4b843a7492
1 changed files with 4 additions and 2 deletions

View 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()