File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,16 @@ def _is_xdist_controller(config):
83
83
return _get_xdist_workerinput (config ) is None
84
84
85
85
86
+ class MypyXdistControllerPlugin :
87
+ """A plugin that is only registered on xdist controller processes."""
88
+
89
+ def pytest_configure_node (self , node ):
90
+ """Pass the config stash to workers."""
91
+ _get_xdist_workerinput (node )["mypy_config_stash_serialized" ] = (
92
+ node .config .stash [stash_key ["config" ]].serialized ()
93
+ )
94
+
95
+
86
96
def pytest_configure (config ):
87
97
"""
88
98
Initialize the path used to cache mypy results,
@@ -105,15 +115,7 @@ def pytest_configure(config):
105
115
# If xdist is enabled, then the results path should be exposed to
106
116
# the workers so that they know where to read parsed results from.
107
117
if config .pluginmanager .getplugin ("xdist" ):
108
-
109
- class _MypyXdistPlugin :
110
- def pytest_configure_node (self , node ): # xdist hook
111
- """Pass the mypy results path to workers."""
112
- _get_xdist_workerinput (node )["mypy_config_stash_serialized" ] = (
113
- node .config .stash [stash_key ["config" ]].serialized ()
114
- )
115
-
116
- config .pluginmanager .register (_MypyXdistPlugin ())
118
+ config .pluginmanager .register (MypyXdistControllerPlugin ())
117
119
118
120
config .addinivalue_line (
119
121
"markers" ,
You can’t perform that action at this time.
0 commit comments