Replies: 1 comment 3 replies
-
One solution would be to look at the option itself: import os
def pytest_configure(config):
if "PYTEST_XDIST_WORKER" in os.environ:
return
if config.getoption("distmode") == "each":
...
elif config.getoption("distmode") == "load":
... Note that this will only work on the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
During setup (deep inside a call chain, far from the actual module setup function) I need to create a log/tmp directory path for the tests that will be running. I want this to work for
--dist=loadfile
as well as--dist=each
. For theeach
case I will add the worker as a sub-directory so each run does not conflict; however, for theloadfile
case (which most people will use) I do not want to do that, as the added "gw0", "gw1", ... directory just obfuscates things.So, what I need to do is a way to determine which type of scheduler is being run (or some indication that multiple of each test can be running at the same time). How could I do this? I do have a
pytest_configure()
in my conftest.py if that might be one place to check?Beta Was this translation helpful? Give feedback.
All reactions