Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(49060)

Unified Diff: Lib/test/test_ossaudiodev.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_os.py ('k') | Lib/test/test_peepholer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_ossaudiodev.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_ossaudiodev.py Fri Feb 07 23:40:05 2014 +0200
@@ -76,7 +76,7 @@
# set parameters based on .au file headers
dsp.setparameters(AFMT_S16_NE, nchannels, rate)
- self.assertTrue(abs(expected_time - 3.51) < 1e-2, expected_time)
+ self.assertAlmostEqual(expected_time, 3.51, delta=1e-2)
t1 = time.time()
dsp.write(data)
dsp.close()
@@ -84,7 +84,7 @@
elapsed_time = t2 - t1
percent_diff = (abs(elapsed_time - expected_time) / expected_time) * 100
- self.assertTrue(percent_diff <= 10.0,
+ self.assertLessEqual(percent_diff, 10.0,
"elapsed time (%s) > 10%% off of expected time (%s)" %
(elapsed_time, expected_time))
« no previous file with comments | « Lib/test/test_os.py ('k') | Lib/test/test_peepholer.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+