diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-17 00:38:32 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-17 00:38:32 (GMT) |
commit | 7a5dc75545dfd7733a4ad9ebdd0ae2748a6d9bf1 (patch) | |
tree | 4cbe83b49667fea0c26fc0d66eab1391ef9b8235 /Lib/test/test_ossaudiodev.py | |
parent | 47d305d6891ebc049153086585a3b486cb71a415 (diff) | |
download | cpython-7a5dc75545dfd7733a4ad9ebdd0ae2748a6d9bf1.zip cpython-7a5dc75545dfd7733a4ad9ebdd0ae2748a6d9bf1.tar.gz cpython-7a5dc75545dfd7733a4ad9ebdd0ae2748a6d9bf1.tar.bz2 |
#3567: fix sunau for running with -bb and make test_ossaudiodev work.
Diffstat (limited to 'Lib/test/test_ossaudiodev.py')
-rw-r--r-- | Lib/test/test_ossaudiodev.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index e07ad1b..0e9ba45 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -57,7 +57,7 @@ class OSSAudioDevTests(unittest.TestCase): dsp.fileno() # Make sure the read-only attributes work. - self.failUnless(dsp.close) + self.failIf(dsp.closed) self.assertEqual(dsp.name, "/dev/dsp") self.assertEqual(dsp.mode, "w", "bad dsp.mode: %r" % dsp.mode) @@ -65,7 +65,7 @@ class OSSAudioDevTests(unittest.TestCase): for attr in ('closed', 'name', 'mode'): try: setattr(dsp, attr, 42) - except TypeError: + except (TypeError, AttributeError): pass else: self.fail("dsp.%s not read-only" % attr) @@ -75,7 +75,7 @@ class OSSAudioDevTests(unittest.TestCase): # set parameters based on .au file headers dsp.setparameters(AFMT_S16_NE, nchannels, rate) - self.assertEquals("%.2f" % expected_time, "2.93") + self.assertTrue(abs(expected_time - 2.94) < 1e-2, expected_time) t1 = time.time() dsp.write(data) dsp.close() |