From 1e45c58a55504451bef995ce9dcfe71ec504c33a Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 17 Aug 2008 00:36:03 +0000 Subject: [PATCH] Make test_ossaudiodev work. --- Lib/test/test_ossaudiodev.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index eb4dd028905..2a1eba7e53a 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -56,7 +56,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) @@ -74,7 +74,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()