-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handy API to know information about master/slaves from session #504
Comments
smarie
changed the title
Handy API to know
Handy API to know information about master/slaves from session
Feb 14, 2020
Implementation note :
|
smarie
pushed a commit
to smarie/pytest-xdist
that referenced
this issue
Feb 18, 2020
Update: actually a better way was just to check at I'll push a PR in a minute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As mentioned in smarie/python-pytest-harvest#36 (and discussed already with @nicoddemus in smarie/python-pytest-harvest#32) it would be great to have an elegant API to answer these simple questions:
get_xdist_worker_id(session)
: would returnsession.config.slaveinput['slaveid']
or raise an exception if this not an xdist workeris_xdist_worker(session)
: would returnTrue
if this is an xdist worker,False
otherwiseis_xdist_master(session)
: would returnTrue
if this is the xdist master,False
otherwise (important: this would returnFalse
when distribution has not been activated and "normal" pytest has been run on a single process)Would you like a PR for this ?
When/if this API is done, we should not forget to post the answer on this SO question
The text was updated successfully, but these errors were encountered: