@@ -327,17 +327,18 @@ class MypyWarning(pytest.PytestWarning):
327327
328328def pytest_terminal_summary (terminalreporter , config ):
329329 """Report stderr and unrecognized lines from stdout."""
330- try :
331- with open (config ._mypy_results_path , mode = "r" ) as results_f :
332- results = MypyResults .load (results_f )
333- except FileNotFoundError :
334- # No MypyItems executed.
335- return
336- if results .unmatched_stdout or results .stderr :
337- terminalreporter .section ("mypy" )
338- if results .unmatched_stdout :
339- color = {"red" : True } if results .status else {"green" : True }
340- terminalreporter .write_line (results .unmatched_stdout , ** color )
341- if results .stderr :
342- terminalreporter .write_line (results .stderr , yellow = True )
343- os .remove (config ._mypy_results_path )
330+ if _is_master (config ):
331+ try :
332+ with open (config ._mypy_results_path , mode = "r" ) as results_f :
333+ results = MypyResults .load (results_f )
334+ except FileNotFoundError :
335+ # No MypyItems executed.
336+ return
337+ if results .unmatched_stdout or results .stderr :
338+ terminalreporter .section ("mypy" )
339+ if results .unmatched_stdout :
340+ color = {"red" : True } if results .status else {"green" : True }
341+ terminalreporter .write_line (results .unmatched_stdout , ** color )
342+ if results .stderr :
343+ terminalreporter .write_line (results .stderr , yellow = True )
344+ os .remove (config ._mypy_results_path )
0 commit comments