Skip to content

Commit 8656670

Browse files
authored
weaken pthread_getcpuclockid test (more bpo-31596) (#3904)
There just isn't much we can assert in a portable way.
1 parent 7faf7e5 commit 8656670

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Lib/test/test_time.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,13 @@ def test_clock_monotonic(self):
8585
'need time.pthread_getcpuclockid()')
8686
@unittest.skipUnless(hasattr(time, 'clock_gettime'),
8787
'need time.clock_gettime()')
88-
@unittest.skipUnless(hasattr(time, 'CLOCK_THREAD_CPUTIME_ID'),
89-
'need time.CLOCK_THREAD_CPUTIME_ID')
9088
def test_pthread_getcpuclockid(self):
9189
clk_id = time.pthread_getcpuclockid(threading.get_ident())
9290
self.assertTrue(type(clk_id) is int)
9391
self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
94-
# This should suffice to show that both calls are measuring the same clock.
9592
t1 = time.clock_gettime(clk_id)
96-
t2 = time.clock_gettime(time.CLOCK_THREAD_CPUTIME_ID)
97-
t3 = time.clock_gettime(clk_id)
98-
t4 = time.clock_gettime(time.CLOCK_THREAD_CPUTIME_ID)
93+
t2 = time.clock_gettime(clk_id)
9994
self.assertLessEqual(t1, t2)
100-
self.assertLessEqual(t2, t3)
101-
self.assertLessEqual(t3, t4)
10295

10396
@unittest.skipUnless(hasattr(time, 'clock_getres'),
10497
'need time.clock_getres()')

0 commit comments

Comments
 (0)