Does pants* know how to use xdist?
# development
m
Does pants* know how to use xdist?
Found the relevant docs
e
It does not. It runs each test file in parallel with all others. It cannot, however run each test within a file in parallel like xdist can.
So if you have a huge test file with lots of slow tests, that will be the long pole.
m
Can I get a worker from pants?
Or better, can I tell if pants is running me?
e
I'm not sure what you mean by a worker - can you explain more?
m
Context: I’m using
pytest-django
which creates a different db for each worker
e
Ah, gotcha - we expose an environment variable for things like this - just a sec...
You want to confgure an environment variable name in your pants.toml for `[pytest] execution_slot_var`: https://www.pantsbuild.org/docs/reference-pytest#section-execution-slot-var
m
Seems to work! Thanks!
e
I'm not too Django literate, but we do want to support Django as best possible; so if you find anything hard or confusing to do - please file issues or ask.