summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorpxinwr <peixing.xin@windriver.com>2019-04-15 09:06:21 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-04-15 09:06:21 (GMT)
commitf1464f4d2ecf9b809ff768c523c5eea1abd31c55 (patch)
tree5955ee8faf8a1e4f8bea308219740465ac082920 /Lib
parent236d0b75c41449a266201c683b4b0d6acdee02df (diff)
downloadcpython-f1464f4d2ecf9b809ff768c523c5eea1abd31c55.zip
cpython-f1464f4d2ecf9b809ff768c523c5eea1abd31c55.tar.gz
cpython-f1464f4d2ecf9b809ff768c523c5eea1abd31c55.tar.bz2
bpo-31904: Port the time module on VxWorks (GH-12305)
time.clock() is not available on VxWorks.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_time.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 136ad29..3039189 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -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':