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