pytest
-n
def pytest_sessionfinish(session):
try:
pytest_worker_id = session.config.slaveinput['slaveid']
except AttributeError:
# TODO disambiguate: are we the xdist master node or the "main" pytest node with xdist deactivated?
...
注意:这是为了摆脱这种尝试
conftest.py example
谨致问候