mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-31904: Port the time module on VxWorks (GH-12305)
time.clock() is not available on VxWorks.
This commit is contained in:
parent
236d0b75c4
commit
f1464f4d2e
4 changed files with 15 additions and 5 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue