Commit 1c5ae55c authored by Benjamin Peterson's avatar Benjamin Peterson

don't use assertEqual for test for bool equality

parent 8fbd2954
...@@ -30,16 +30,16 @@ class TimeTestCase(unittest.TestCase): ...@@ -30,16 +30,16 @@ class TimeTestCase(unittest.TestCase):
def test_time(self): def test_time(self):
time.time() time.time()
info = time.get_clock_info('time') info = time.get_clock_info('time')
self.assertEqual(info.monotonic, False) self.assertFalse(info.monotonic)
if sys.platform != 'win32': if sys.platform != 'win32':
self.assertEqual(info.adjusted, True) self.assertTrue(info.adjusted)
def test_clock(self): def test_clock(self):
time.clock() time.clock()
info = time.get_clock_info('clock') info = time.get_clock_info('clock')
self.assertEqual(info.monotonic, True) self.assertTrue(info.monotonic)
self.assertEqual(info.adjusted, False) self.assertFalse(info.adjusted)
@unittest.skipUnless(hasattr(time, 'clock_gettime'), @unittest.skipUnless(hasattr(time, 'clock_gettime'),
'need time.clock_gettime()') 'need time.clock_gettime()')
...@@ -370,11 +370,11 @@ class TimeTestCase(unittest.TestCase): ...@@ -370,11 +370,11 @@ class TimeTestCase(unittest.TestCase):
self.assertAlmostEqual(dt, 0.1, delta=0.2) self.assertAlmostEqual(dt, 0.1, delta=0.2)
info = time.get_clock_info('monotonic') info = time.get_clock_info('monotonic')
self.assertEqual(info.monotonic, True) self.assertTrue(info.monotonic)
if sys.platform == 'linux': if sys.platform == 'linux':
self.assertEqual(info.adjusted, True) self.assertTrue(info.adjusted)
else: else:
self.assertEqual(info.adjusted, False) self.assertFalse(info.adjusted)
def test_perf_counter(self): def test_perf_counter(self):
time.perf_counter() time.perf_counter()
...@@ -386,8 +386,8 @@ class TimeTestCase(unittest.TestCase): ...@@ -386,8 +386,8 @@ class TimeTestCase(unittest.TestCase):
self.assertLess(stop - start, 0.01) self.assertLess(stop - start, 0.01)
info = time.get_clock_info('process_time') info = time.get_clock_info('process_time')
self.assertEqual(info.monotonic, True) self.assertTrue(info.monotonic)
self.assertEqual(info.adjusted, False) self.assertFalse(info.adjusted)
@unittest.skipUnless(hasattr(time, 'monotonic'), @unittest.skipUnless(hasattr(time, 'monotonic'),
'need time.monotonic') 'need time.monotonic')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment