pytest-xdist

pytest, xdist, and sharing generated file dependencies

pytest, xdist, and sharing generated file dependencies Question: I have multiple tests that need require an expensive-to-generate file. I’d like the file to be re-generated on every test run, but no more than once. To complicate the matter, both these tests as well as the file depend on an input parameter. def expensive(param) -> Path: …

Total answers: 1

pytest-xdist – running parametrized fixtures for parametrized tests once without blocking

pytest-xdist – running parametrized fixtures for parametrized tests once without blocking Question: Consider the following example (which is a simple template of my real issue, of course): import time import pytest @pytest.fixture(scope="session", params=[1, 2, 3, 4, 5]) def heavy_computation(request): print(f"heavy_computation – param is {request.param}") time.sleep(10) return request.param @pytest.mark.parametrize("param", ["A", "B", "C", "D", "E"]) def test_heavy_computation(param, …

Total answers: 1

Why is pytest asking to specify –tx

Why is pytest asking to specify –tx Question: After multiple successful tests, pytest is suddenly throwing this error: $ pytest -vvv -x –internal –oclint -n -32 ============================= test session starts ============================== platform darwin — Python 3.7.7, pytest-5.4.1, py-1.7.0, pluggy-0.13.1 — /usr/local/opt/python/bin/python3.7 cachedir: .pytest_cache rootdir: /Users/pre-commit-hooks/code/pre-commit-hooks, inifile: pytest.ini plugins: xdist-1.31.0, forked-1.1.3 ERROR: MISSING test execution (tx) …

Total answers: 3