@@ -67,7 +67,7 @@ def report_line(self, line):
6767 if self .terminal and self .config .option .verbose >= 0 :
6868 self .terminal .write_line (line )
6969
70- @pytest .mark . trylast
70+ @pytest .hookimpl ( trylast = True )
7171 def pytest_sessionstart (self , session ):
7272 """Creates and starts the nodes.
7373
@@ -79,18 +79,20 @@ def pytest_sessionstart(self, session):
7979 self ._active_nodes .update (nodes )
8080 self ._session = session
8181
82+ @pytest .hookimpl
8283 def pytest_sessionfinish (self , session ):
8384 """Shutdown all nodes."""
8485 nm = getattr (self , "nodemanager" , None ) # if not fully initialized
8586 if nm is not None :
8687 nm .teardown_nodes ()
8788 self ._session = None
8889
90+ @pytest .hookimpl
8991 def pytest_collection (self ):
9092 # prohibit collection of test items in controller process
9193 return True
9294
93- @pytest .mark . trylast
95+ @pytest .hookimpl ( trylast = True )
9496 def pytest_xdist_make_scheduler (self , config , log ):
9597 dist = config .getvalue ("dist" )
9698 schedulers = {
@@ -101,6 +103,7 @@ def pytest_xdist_make_scheduler(self, config, log):
101103 }
102104 return schedulers [dist ](config , log )
103105
106+ @pytest .hookimpl
104107 def pytest_runtestloop (self ):
105108 self .sched = self .config .hook .pytest_xdist_make_scheduler (
106109 config = self .config , log = self .log
@@ -223,6 +226,7 @@ def worker_errordown(self, node, error):
223226 self ._clone_node (node )
224227 self ._active_nodes .remove (node )
225228
229+ @pytest .hookimpl
226230 def pytest_terminal_summary (self , terminalreporter ):
227231 if self .config .option .verbose >= 0 and self ._summary_report :
228232 terminalreporter .write_sep ("=" , "xdist: {}" .format (self ._summary_report ))
@@ -390,13 +394,15 @@ def rewrite(self, line, newline=False):
390394 self ._lastlen = len (line )
391395 self .tr .rewrite (pline , bold = True )
392396
397+ @pytest .hookimpl
393398 def pytest_xdist_setupnodes (self , specs ):
394399 self ._specs = specs
395400 for spec in specs :
396401 self .setstatus (spec , "I" , show = False )
397402 self .setstatus (spec , "I" , show = True )
398403 self .ensure_show_status ()
399404
405+ @pytest .hookimpl
400406 def pytest_xdist_newgateway (self , gateway ):
401407 if self .config .option .verbose > 0 :
402408 rinfo = gateway ._rinfo ()
@@ -408,6 +414,7 @@ def pytest_xdist_newgateway(self, gateway):
408414 )
409415 self .setstatus (gateway .spec , "C" )
410416
417+ @pytest .hookimpl
411418 def pytest_testnodeready (self , node ):
412419 if self .config .option .verbose > 0 :
413420 d = node .workerinfo
@@ -417,6 +424,7 @@ def pytest_testnodeready(self, node):
417424 self .rewrite (infoline , newline = True )
418425 self .setstatus (node .gateway .spec , "ok" )
419426
427+ @pytest .hookimpl
420428 def pytest_testnodedown (self , node , error ):
421429 if not error :
422430 return
0 commit comments