diff options
author | Guido van Rossum <guido@python.org> | 2002-08-09 16:38:32 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-08-09 16:38:32 (GMT) |
commit | 3b0a3293c369f3c3f4753e3cb9172cb4e242af76 (patch) | |
tree | e0f9d295c0a2897ddfb7a5bf3b076be70f1492b4 /Lib/test/test_wave.py | |
parent | 830a5151c1e2ed4d0c647efb4ad54a9a6c67e4ae (diff) | |
download | cpython-3b0a3293c369f3c3f4753e3cb9172cb4e242af76.zip cpython-3b0a3293c369f3c3f4753e3cb9172cb4e242af76.tar.gz cpython-3b0a3293c369f3c3f4753e3cb9172cb4e242af76.tar.bz2 |
Massive changes from SF 589982 (tempfile.py rewrite, by Zack
Weinberg). This changes all uses of deprecated tempfile functions to
the recommended ones.
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r-- | Lib/test/test_wave.py | 12 |
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) |