diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5dce6db36..c0e2bc4f8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,7 +43,7 @@ jobs: - name: run tests timeout-minutes: 30 run: > - pytest -nauto --timeout=300 --durations=100 + pytest -n=logical --timeout=300 --durations=100 --cov --cov-report=xml --cov-report=term - name: upload coverage report uses: codecov/codecov-action@v3 diff --git a/pyproject.toml b/pyproject.toml index b17ea547c..42cb397ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,7 +101,7 @@ tests = [ "pytest-mock", "pytest-test-utils", "pytest-timeout>=2", - "pytest-xdist>=3", + "pytest-xdist>=3.2", 'pywin32>=225; sys_platform == "win32"', # optional test dependency ] webdav = ["dvc-webdav==2.19.1"] @@ -131,7 +131,7 @@ known_first_party = ["dvc", "dvc_data", "dvc_objects", "dvc_render", "dvc_task", profile = "black" [tool.pytest.ini_options] -addopts = "-ra --cov-config pyproject.toml" +addopts = "-ra --cov-config pyproject.toml --dist worksteal" filterwarnings = [ "error::pytest_mock.PytestMockWarning", # remove when aiobotocore supports botocore>=1.29.13 diff --git a/tests/__main__.py b/tests/__main__.py index 79fbed045..17be5f8af 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -3,4 +3,4 @@ if __name__ == "__main__": import pytest - sys.exit(pytest.main(["-v", "-n=auto", *sys.argv[1:]])) + sys.exit(pytest.main(["-v", "-n=logical", *sys.argv[1:]]))