@@ -444,26 +444,25 @@ def pytest_xdist_setupnodes(self, specs) -> None:
444
444
445
445
@pytest .hookimpl
446
446
def pytest_xdist_newgateway (self , gateway ) -> None :
447
- rinfo = gateway . _rinfo ()
448
- is_local = rinfo . executable == sys . executable
449
- if self . config . option . verbose > 0 and not is_local :
450
- version = "%s.%s.%s" % rinfo . version_info [: 3 ]
451
- self . rewrite (
452
- "[%s] %s Python %s cwd: %s"
453
- % ( gateway .id , rinfo .platform , version , rinfo .cwd ) ,
454
- newline = True ,
455
- )
447
+ if self . config . option . verbose > 0 :
448
+ rinfo = gateway . _rinfo ()
449
+ different_interpreter = rinfo . executable != sys . executable
450
+ if different_interpreter :
451
+ version = "%s.%s.%s" % rinfo . version_info [: 3 ]
452
+ self . rewrite (
453
+ f"[ { gateway .id } ] { rinfo .platform } Python { version } cwd: { rinfo .cwd } " ,
454
+ newline = True ,
455
+ )
456
456
self .setstatus (gateway .spec , WorkerStatus .Initialized , tests_collected = 0 )
457
457
458
458
@pytest .hookimpl
459
459
def pytest_testnodeready (self , node ) -> None :
460
- d = node .workerinfo
461
- is_local = d .get ("executable" ) == sys .executable
462
- if self .config .option .verbose > 0 and not is_local :
463
- infoline = "[{}] Python {}" .format (
464
- d ["id" ], d ["version" ].replace ("\n " , " -- " )
465
- )
466
- self .rewrite (infoline , newline = True )
460
+ if self .config .option .verbose > 0 :
461
+ d = node .workerinfo
462
+ different_interpreter = d .get ("executable" ) != sys .executable
463
+ if different_interpreter :
464
+ version = d ["version" ].replace ("\n " , " -- " )
465
+ self .rewrite (f"[{ d ['id' ]} ] Python { version } " , newline = True )
467
466
self .setstatus (
468
467
node .gateway .spec , WorkerStatus .ReadyForCollection , tests_collected = 0
469
468
)
0 commit comments