@@ -556,20 +556,26 @@ def test_localtime_failure(self):
556
556
self .assertRaises (ValueError , time .ctime , float ("nan" ))
557
557
558
558
def test_get_clock_info (self ):
559
- clocks = ['monotonic' , 'perf_counter' , 'process_time' , 'time' ]
559
+ clocks = [
560
+ 'monotonic' ,
561
+ 'perf_counter' ,
562
+ 'process_time' ,
563
+ 'time' ,
564
+ 'thread_time' ,
565
+ ]
560
566
561
567
for name in clocks :
562
- info = time . get_clock_info (name )
563
-
564
- #self.assertIsInstance(info, dict)
565
- self .assertIsInstance (info .implementation , str )
566
- self .assertNotEqual (info .implementation , '' )
567
- self .assertIsInstance (info .monotonic , bool )
568
- self .assertIsInstance (info .resolution , float )
569
- # 0.0 < resolution <= 1.0
570
- self .assertGreater (info .resolution , 0.0 )
571
- self .assertLessEqual (info .resolution , 1.0 )
572
- self .assertIsInstance (info .adjustable , bool )
568
+ with self . subTest (name = name ):
569
+ info = time . get_clock_info ( name )
570
+
571
+ self .assertIsInstance (info .implementation , str )
572
+ self .assertNotEqual (info .implementation , '' )
573
+ self .assertIsInstance (info .monotonic , bool )
574
+ self .assertIsInstance (info .resolution , float )
575
+ # 0.0 < resolution <= 1.0
576
+ self .assertGreater (info .resolution , 0.0 )
577
+ self .assertLessEqual (info .resolution , 1.0 )
578
+ self .assertIsInstance (info .adjustable , bool )
573
579
574
580
self .assertRaises (ValueError , time .get_clock_info , 'xxx' )
575
581
0 commit comments