[Python-checkins] cpython: don't use assertEqual for test for bool equality

benjamin.peterson python-checkins at python.org
Tue May 1 17:14:37 CEST 2012


http://hg.python.org/cpython/rev/bec267540811
changeset: 76700:bec267540811
parent: 76697:e1a200dfd5db
user: Benjamin Peterson <benjamin at python.org>
date: Tue May 01 11:14:32 2012 -0400
summary:
 don't use assertEqual for test for bool equality
files:
 Lib/test/test_time.py | 18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -30,16 +30,16 @@
 def test_time(self):
 time.time()
 info = time.get_clock_info('time')
- self.assertEqual(info.monotonic, False)
+ self.assertFalse(info.monotonic)
 if sys.platform != 'win32':
- self.assertEqual(info.adjusted, True)
+ self.assertTrue(info.adjusted)
 
 def test_clock(self):
 time.clock()
 
 info = time.get_clock_info('clock')
- self.assertEqual(info.monotonic, True)
- self.assertEqual(info.adjusted, False)
+ self.assertTrue(info.monotonic)
+ self.assertFalse(info.adjusted)
 
 @unittest.skipUnless(hasattr(time, 'clock_gettime'),
 'need time.clock_gettime()')
@@ -370,11 +370,11 @@
 self.assertAlmostEqual(dt, 0.1, delta=0.2)
 
 info = time.get_clock_info('monotonic')
- self.assertEqual(info.monotonic, True)
+ self.assertTrue(info.monotonic)
 if sys.platform == 'linux':
- self.assertEqual(info.adjusted, True)
+ self.assertTrue(info.adjusted)
 else:
- self.assertEqual(info.adjusted, False)
+ self.assertFalse(info.adjusted)
 
 def test_perf_counter(self):
 time.perf_counter()
@@ -386,8 +386,8 @@
 self.assertLess(stop - start, 0.01)
 
 info = time.get_clock_info('process_time')
- self.assertEqual(info.monotonic, True)
- self.assertEqual(info.adjusted, False)
+ self.assertTrue(info.monotonic)
+ self.assertFalse(info.adjusted)
 
 @unittest.skipUnless(hasattr(time, 'monotonic'),
 'need time.monotonic')
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /