Skip to content
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

tests: --update-data incompatible with xdist #15641

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mypy/test/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,13 @@ def pytest_addoption(parser: Any) -> None:
)


def pytest_configure(config: pytest.Config) -> None:
if config.getoption("--update-data") and config.getoption("--numprocesses", default=1) > 1:
raise pytest.UsageError(
"--update-data incompatible with parallelized tests; re-run with -n 1"
)


# This function name is special to pytest. See
# https://doc.pytest.org/en/latest/how-to/writing_plugins.html#collection-hooks
def pytest_pycollect_makeitem(collector: Any, name: str, obj: object) -> Any | None:
Expand Down
Loading