File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -977,19 +977,12 @@ def pytest_sessionfinish(self, session):
977977 Save out the hash library at the end of the run.
978978 """
979979 config = session .config
980- try :
981- import xdist
982- is_xdist_controller = xdist .is_xdist_controller (session )
983- is_xdist_worker = xdist .is_xdist_worker (session )
984- except ImportError :
985- is_xdist_controller = False
986- is_xdist_worker = False
987- except Exception as e :
988- if "xdist" not in session .config .option :
989- is_xdist_controller = False
990- is_xdist_worker = False
991- else :
992- raise e
980+ is_xdist_worker = hasattr (config , "workerinput" )
981+ is_xdist_controller = (
982+ config .pluginmanager .hasplugin ("xdist" )
983+ and not is_xdist_worker
984+ and getattr (config .option , "dist" , "" ) != "no"
985+ )
993986
994987 if is_xdist_controller : # Merge results from workers
995988 uid = config .pytest_mpl_uid
You can’t perform that action at this time.
0 commit comments