summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_time.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-10-06 05:50:42 (GMT)
committerGitHub <noreply@github.com>2017-10-06 05:50:42 (GMT)
commit86566702f311f8e90600e85350f6b6769a384ea5 (patch)
treeb8fd2a758b6c21b557fda1bc3ccf34310fc0c9d5 /Lib/test/test_time.py
parent7faf7e50757dde2cb8583ee08ef31f4b8312e44f (diff)
downloadcpython-86566702f311f8e90600e85350f6b6769a384ea5.zip
cpython-86566702f311f8e90600e85350f6b6769a384ea5.tar.gz
cpython-86566702f311f8e90600e85350f6b6769a384ea5.tar.bz2
weaken pthread_getcpuclockid test (more bpo-31596) (#3904)
There just isn't much we can assert in a portable way.
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r--Lib/test/test_time.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 1456748..c92e66b 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -85,20 +85,13 @@ class TimeTestCase(unittest.TestCase):
'need time.pthread_getcpuclockid()')
@unittest.skipUnless(hasattr(time, 'clock_gettime'),
'need time.clock_gettime()')
- @unittest.skipUnless(hasattr(time, 'CLOCK_THREAD_CPUTIME_ID'),
- 'need time.CLOCK_THREAD_CPUTIME_ID')
def test_pthread_getcpuclockid(self):
clk_id = time.pthread_getcpuclockid(threading.get_ident())
self.assertTrue(type(clk_id) is int)
self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
- # This should suffice to show that both calls are measuring the same clock.
t1 = time.clock_gettime(clk_id)
- t2 = time.clock_gettime(time.CLOCK_THREAD_CPUTIME_ID)
- t3 = time.clock_gettime(clk_id)
- t4 = time.clock_gettime(time.CLOCK_THREAD_CPUTIME_ID)
+ t2 = time.clock_gettime(clk_id)
self.assertLessEqual(t1, t2)
- self.assertLessEqual(t2, t3)
- self.assertLessEqual(t3, t4)
@unittest.skipUnless(hasattr(time, 'clock_getres'),
'need time.clock_getres()')