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

Run tox tests in parallel #1247

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changes/1247.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Python tests are now run in parallel via ``tox``.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ requires = ["setuptools>=60", "setuptools_scm[toml]>=7.0"]
build-backend = "setuptools.build_meta"

[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
parallel = true
sigterm = true
branch = true
relative_files = true
source_pkgs = ["briefcase"]
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ install_requires =
# ensure environment consistency.
dev =
coverage[toml] == 7.2.3
coverage-enable-subprocess == 1.0
pre-commit == 3.2.2
pytest == 7.3.1
pytest-xdist == 3.2.1
setuptools_scm[toml] == 7.1.0
tox == 4.4.12
docs =
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def no_print(monkeypatch):

@pytest.fixture
def sleep_zero(monkeypatch):
"""Replace all calls to ``time.sleep(x)`` with ``time.sleep(0)."""
"""Replace all calls to ``time.sleep(x)`` with ``time.sleep(0)``."""
monkeypatch.setattr(time, "sleep", lambda x: _sleep(0))


Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ download = True
# The leading comma generates the "py" environment.
[testenv:py{,38,39,310,311,312}{,-coverage}]
passenv =
# LOCALAPPDATA is needed to test data directory creation on Windows.
# Needed on Windows to test data directory creation
LOCALAPPDATA
setenv =
# Start Python such that coverage is possible in subprocesses
COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml
extras =
dev
# 2023-04-22 The virtualenv used by Tox has pip 23.1 pinned into it
# This version has a bug on winstore installs of Python, so we
# need to force pip to be updated.
download = True
commands =
python -m coverage run -m pytest -vv {posargs}
python -m coverage run -m pytest {posargs:-n auto -vv}
coverage : python -m coverage combine
coverage : python -m coverage report

Expand Down