You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is_xdist_master is not a drop-in replacement for _is_master for a couple reasons:
It takes request_or_session instead of config.
The only way I know of to get the former from the latter is:
config.pluginmanager.getplugin("session")
It returns False if xdist is not active.
We could get around this by using not is_xdist_worker.
Even though we could make it work, I see 2 problems with proceeding:
No APIs can replace _get_xdist_workerinput (which isn't surprising, since it's a compatibility shim -- but even ignoring that, we still have to know about config.workerinput).
Accessing the APIs requires accessing xdist, which we'd probably want a helper function for:
That basically just means re-implementing _is_master in a slower (though, perhaps more correct) way.
I think 1 is really the deal-breaker. The only way we can justify making _is_master slower is if it is indeed more correct. By that I mean: xdist could redefine how to identify an xdist worker without breaking us. If they did that, though, _get_xdist_workerinput would most likely still break.
pytest-dev/pytest-xdist#505
Seems like an upstreamed version of
_is_master
:https://github.com/dbader/pytest-mypy/blob/3dc75dfc5c4ae6ee6dc0d35b88f7898221c3d089/src/pytest_mypy.py#L53-L58
Maybe this project should take advantage of them 🤔
The text was updated successfully, but these errors were encountered: