mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
don't use assertEqual for test for bool equality
This commit is contained in:
parent
8fbd295458
commit
1c5ae55c85
1 changed files with 9 additions and 9 deletions
|
@ -30,16 +30,16 @@ class TimeTestCase(unittest.TestCase):
|
|||
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 @@ class TimeTestCase(unittest.TestCase):
|
|||
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 @@ class TimeTestCase(unittest.TestCase):
|
|||
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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue