summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wave.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r--Lib/test/test_wave.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index a0e913c..1a6ff5c 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -1,5 +1,5 @@
-from test.test_support import TestFailed
-import os, tempfile
+from test.test_support import TestFailed, TESTFN
+import os
import wave
def check(t, msg=None):
@@ -11,9 +11,7 @@ sampwidth = 2
framerate = 8000
nframes = 100
-testfile = tempfile.mktemp()
-
-f = wave.open(testfile, 'wb')
+f = wave.open(TESTFN, 'wb')
f.setnchannels(nchannels)
f.setsampwidth(sampwidth)
f.setframerate(framerate)
@@ -22,7 +20,7 @@ output = '\0' * nframes * nchannels * sampwidth
f.writeframes(output)
f.close()
-f = wave.open(testfile, 'rb')
+f = wave.open(TESTFN, 'rb')
check(nchannels == f.getnchannels(), "nchannels")
check(sampwidth == f.getsampwidth(), "sampwidth")
check(framerate == f.getframerate(), "framerate")
@@ -31,4 +29,4 @@ input = f.readframes(nframes)
check(input == output, "data")
f.close()
-os.remove(testfile)
+os.remove(TESTFN)