@@ -545,20 +545,26 @@ def test_localtime_failure(self):
545
545
self .assertRaises (ValueError , time .ctime , float ("nan" ))
546
546
547
547
def test_get_clock_info (self ):
548
- clocks = ['monotonic' , 'perf_counter' , 'process_time' , 'time' ]
548
+ clocks = [
549
+ 'monotonic' ,
550
+ 'perf_counter' ,
551
+ 'process_time' ,
552
+ 'time' ,
553
+ 'thread_time' ,
554
+ ]
549
555
550
556
for name in clocks :
551
- info = time . get_clock_info (name )
552
-
553
- #self.assertIsInstance(info, dict)
554
- self .assertIsInstance (info .implementation , str )
555
- self .assertNotEqual (info .implementation , '' )
556
- self .assertIsInstance (info .monotonic , bool )
557
- self .assertIsInstance (info .resolution , float )
558
- # 0.0 < resolution <= 1.0
559
- self .assertGreater (info .resolution , 0.0 )
560
- self .assertLessEqual (info .resolution , 1.0 )
561
- self .assertIsInstance (info .adjustable , bool )
557
+ with self . subTest (name = name ):
558
+ info = time . get_clock_info ( name )
559
+
560
+ self .assertIsInstance (info .implementation , str )
561
+ self .assertNotEqual (info .implementation , '' )
562
+ self .assertIsInstance (info .monotonic , bool )
563
+ self .assertIsInstance (info .resolution , float )
564
+ # 0.0 < resolution <= 1.0
565
+ self .assertGreater (info .resolution , 0.0 )
566
+ self .assertLessEqual (info .resolution , 1.0 )
567
+ self .assertIsInstance (info .adjustable , bool )
562
568
563
569
self .assertRaises (ValueError , time .get_clock_info , 'xxx' )
564
570
0 commit comments