A pytest plugin to run tests concurrently using threads. It automatically detects thread-unsafe tests (e.g., using fixtures like tmp_path, monkeypatch, capsys, or mocking) and marks them as serial. Version 0.8.2 supports Python >=3.9. Releases are intermittent.
pip install pytest-run-parallelVerified import paths — ran on the pinned version, not inferred.
Run pytest with parallel threads. The plugin automatically parallelizes tests unless they are detected as thread-unsafe.
To force parallelism on a test that uses thread-unsafe fixtures, mark it with @pytest.mark.parallel. However, this may cause flaky tests.
If you rely on gc.collect in tests, they will now run serially unless you use --disable-thread-unsafe-detection or mark them as parallel.
Avoid using --forever with pytest-xdist. Use --parallel-threads instead for parallel execution.
If you know your mock usage is safe, you can disable detection with --disable-thread-unsafe-detection, but be careful about race conditions.
No dependency data recorded yet.