bpo-31904: Port the time module on VxWorks (GH-12305)

time.clock() is not available on VxWorks.
This commit is contained in:
pxinwr 2019-04-15 17:06:21 +08:00 committed by Victor Stinner
parent 236d0b75c4
commit f1464f4d2e
4 changed files with 15 additions and 5 deletions

View file

@ -88,6 +88,8 @@ class TimeTestCase(unittest.TestCase):
check_ns(time.clock_gettime(time.CLOCK_REALTIME),
time.clock_gettime_ns(time.CLOCK_REALTIME))
@unittest.skipUnless(hasattr(time, 'clock'),
'need time.clock()')
def test_clock(self):
with self.assertWarns(DeprecationWarning):
time.clock()
@ -549,7 +551,9 @@ class TimeTestCase(unittest.TestCase):
self.assertRaises(ValueError, time.ctime, float("nan"))
def test_get_clock_info(self):
clocks = ['clock', 'monotonic', 'perf_counter', 'process_time', 'time']
clocks = ['monotonic', 'perf_counter', 'process_time', 'time']
if hasattr(time, 'clock'):
clocks.append('clock')
for name in clocks:
if name == 'clock':