Compare commits

..

126 Commits

Author SHA1 Message Date
Shane Smiskol
2b4372bd62 gotcha
Some checks failed
test / package (push) Failing after 2m31s
test / test (ubuntu-latest, 3.10, py310-psutil) (push) Has been skipped
test / test (ubuntu-latest, 3.10, py310-pytestlatest) (push) Has been skipped
test / test (ubuntu-latest, 3.10, py310-setproctitle) (push) Has been skipped
test / test (ubuntu-latest, 3.11, py311-pytestlatest) (push) Has been skipped
test / test (ubuntu-latest, 3.11, py311-pytestmain) (push) Has been skipped
test / test (ubuntu-latest, 3.12, py312-pytestlatest) (push) Has been skipped
test / test (ubuntu-latest, 3.13, py313-pytestlatest) (push) Has been skipped
test / test (ubuntu-latest, 3.9, py39-pytestlatest) (push) Has been skipped
test / test (ubuntu-latest, 3.9, py39-pytestmin) (push) Has been skipped
test / test (windows-latest, 3.10, py310-psutil) (push) Has been skipped
test / test (windows-latest, 3.10, py310-pytestlatest) (push) Has been skipped
test / test (windows-latest, 3.10, py310-setproctitle) (push) Has been skipped
test / test (windows-latest, 3.11, py311-pytestlatest) (push) Has been skipped
test / test (windows-latest, 3.11, py311-pytestmain) (push) Has been skipped
test / test (windows-latest, 3.12, py312-pytestlatest) (push) Has been skipped
test / test (windows-latest, 3.13, py313-pytestlatest) (push) Has been skipped
test / test (windows-latest, 3.9, py39-pytestlatest) (push) Has been skipped
test / test (windows-latest, 3.9, py39-pytestmin) (push) Has been skipped
2025-07-25 19:39:12 -07:00
Shane Smiskol
1bb1a0f62a one line 2025-07-25 19:38:49 -07:00
Shane Smiskol
f8ea4a23b7 fix again 2025-07-25 19:37:34 -07:00
pre-commit-ci[bot]
68bf76dce4 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-07-26 02:35:24 +00:00
Shane Smiskol
28c0a72e3a fix test 2025-07-25 19:35:11 -07:00
pre-commit-ci[bot]
9d7dcae9d2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-07-26 02:14:35 +00:00
Shane Smiskol
a3374b8d5c clean up 2025-07-25 19:14:22 -07:00
Shane Smiskol
5824f221ca clean up 2025-07-25 19:14:10 -07:00
pre-commit-ci[bot]
6ca0790e02 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-07-26 02:12:40 +00:00
Shane Smiskol
b59e010821 parallel 2025-07-25 18:50:32 -07:00
pre-commit-ci[bot]
239def9be9 Merge pull request #1227 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-07-14 19:34:51 -03:00
pre-commit-ci[bot]
ec87d0a139 [pre-commit.ci] pre-commit autoupdate (#1226)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.1 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.1...v0.12.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-07-08 08:43:31 +02:00
Bruno Oliveira
fe10f1c411 Merge pull request #1224 from pytest-dev/release-3.8.0
Release 3.8.0
2025-07-01 10:31:26 -03:00
pre-commit-ci[bot]
3572d0b13c [pre-commit.ci] pre-commit autoupdate (#1223)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.0 → v0.12.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.0...v0.12.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-30 18:33:44 -03:00
Bruno Oliveira
1e3e4dc165 Release 3.8.0 2025-06-30 11:05:48 -03:00
Shane Smiskol
600aad575a Ensure all xdist group names are strings (#1216) 2025-06-30 11:01:27 -03:00
darwintree
9d7ba5b5fb Add --no-loadscope-reorder and --loadscope-reorder options (#1217)
Based on #1098.

Closes #1098

---------

Co-authored-by: Toan Vuong <toan.vuong@hyperscience.com>
2025-06-30 10:59:40 -03:00
Bruno Oliveira
532f07fb18 Merge pull request #1210 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-06-24 08:24:11 -03:00
Bruno Oliveira
0883ad085e Fix Path usage in test_rsync_roots_no_roots 2025-06-24 08:21:48 -03:00
pre-commit-ci[bot]
58a51bc140 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.11 → v0.12.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.11...v0.12.0)
- [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.16.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.16.1)
2025-06-23 20:16:47 +00:00
Bruno Oliveira
59a2ad0150 Merge pull request #1220 from pytest-dev/dependabot/github_actions/github-actions-33a29a28f8
build(deps): bump hynek/build-and-inspect-python-package from 2.12 to 2.13 in the github-actions group
2025-06-16 17:43:36 -03:00
dependabot[bot]
d42b9c7204 build(deps): bump hynek/build-and-inspect-python-package
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.12 to 2.13
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.12...v2.13)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-version: '2.13'
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 19:13:50 +00:00
Bruno Oliveira
ebfcb99072 Merge pull request #1206 from pytest-dev/release-3.7.0
Release 3.7.0
2025-05-26 18:24:03 -03:00
pre-commit-ci[bot]
23b7fd6054 [pre-commit.ci] pre-commit autoupdate (#1207)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.10 → v0.11.11](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.10...v0.11.11)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-26 22:52:00 +02:00
Bruno Oliveira
b561916eaf Release 3.7.0 2025-05-26 14:51:07 -03:00
pre-commit-ci[bot]
71bd3ede19 [pre-commit.ci] pre-commit autoupdate (#1204)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.9 → v0.11.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.9...v0.11.10)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-19 22:37:54 +02:00
Ygor Pontelo
65de0ab30e Join multiple xdist_group markers (#1201)
Fixes #1200

---------

Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
2025-05-14 21:51:59 -03:00
pre-commit-ci[bot]
199f949716 [pre-commit.ci] pre-commit autoupdate (#1202)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.11.9)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-12 22:33:00 +02:00
pre-commit-ci[bot]
b0215da1ed [pre-commit.ci] pre-commit autoupdate (#1199)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.7 → v0.11.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.7...v0.11.8)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-05 22:53:19 +02:00
pre-commit-ci[bot]
18e47853ed [pre-commit.ci] pre-commit autoupdate (#1198)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.6 → v0.11.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.6...v0.11.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-28 22:58:57 +02:00
pre-commit-ci[bot]
731c05d86a [pre-commit.ci] pre-commit autoupdate (#1197)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.5 → v0.11.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.5...v0.11.6)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-21 22:34:41 +02:00
pre-commit-ci[bot]
16c5be3203 [pre-commit.ci] pre-commit autoupdate (#1195)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.4 → v0.11.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.4...v0.11.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-15 04:51:22 +02:00
pre-commit-ci[bot]
e03757a1d7 [pre-commit.ci] pre-commit autoupdate (#1193)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.2 → v0.11.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.2...v0.11.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-08 06:16:53 +02:00
Ronny Pfannschmidt
f1d81a4402 Merge pull request #1192 from adamchainz/document_disabling
Document disabling with '-n 0'
2025-04-02 20:07:48 +02:00
Adam Johnson
8074c633c8 Document disabling with '-n 0' 2025-04-02 11:36:41 +01:00
Marc Mueller
f83299cd64 Use SPDX license identifier (#1190)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
2025-03-25 13:36:07 +01:00
pre-commit-ci[bot]
4d970380ee [pre-commit.ci] pre-commit autoupdate (#1191)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.0 → v0.11.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.0...v0.11.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-24 21:58:22 +01:00
pre-commit-ci[bot]
10941bad70 [pre-commit.ci] pre-commit autoupdate (#1188)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.10...v0.11.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-17 22:43:23 +01:00
pre-commit-ci[bot]
57e19eca18 [pre-commit.ci] pre-commit autoupdate (#1187)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.9.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.9...v0.9.10)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-10 22:18:38 +01:00
pre-commit-ci[bot]
3dab30ec8a [pre-commit.ci] pre-commit autoupdate (#1185)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.7 → v0.9.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.7...v0.9.9)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-03 22:37:10 +01:00
pre-commit-ci[bot]
3508f8c8ad [pre-commit.ci] pre-commit autoupdate (#1181)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.9.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.6...v0.9.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-26 08:04:12 -03:00
pre-commit-ci[bot]
84a854438c [pre-commit.ci] pre-commit autoupdate (#1177)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.4...v0.9.6)
- [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.1...v1.15.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-11 01:37:37 +01:00
pre-commit-ci[bot]
cb97e7c31a [pre-commit.ci] pre-commit autoupdate (#1175)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.2 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.2...v0.9.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-04 08:53:44 +01:00
dependabot[bot]
adfba2bbb8 build(deps): bump the github-actions group with 2 updates (#1174)
Bumps the github-actions group with 2 updates: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `hynek/build-and-inspect-python-package` from 2.11 to 2.12
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.11...v2.12)

Updates `pypa/gh-action-pypi-publish` from 1.12.3 to 1.12.4
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.3...v1.12.4)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 20:25:10 -03:00
pre-commit-ci[bot]
ab798d52a5 [pre-commit.ci] pre-commit autoupdate (#1173)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.1 → v0.9.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.1...v0.9.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-21 05:03:12 +01:00
Ronny Pfannschmidt
987c2ca896 Merge pull request #1171 from Alon-L/feature/proxy-gateways
Add proxy gateways
2025-01-18 13:14:31 +01:00
Ronny Pfannschmidt
8346acc7fb Merge branch 'master' into feature/proxy-gateways 2025-01-18 10:48:48 +01:00
pre-commit-ci[bot]
59f743487f [pre-commit.ci] pre-commit autoupdate (#1172)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-14 09:57:14 +01:00
pre-commit-ci[bot]
c11ca7a8fe [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-01-12 19:32:01 +00:00
Alon Livne
8632b38203 add tests for proxy gateways
The test `test_proxy_gateway_setup_nodes` makes sure that 2 execnet
gateways are created, but only one node is allocated.

The test `test_proxy_gateway` tries to run a test on a proxy.
2025-01-12 21:30:43 +02:00
pre-commit-ci[bot]
35db0e79c2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-01-12 18:38:19 +00:00
Alon Livne
333e2d3435 add proxy gateways changelog 2025-01-12 20:37:52 +02:00
Alon Livne
17ac3359e3 add proxy gateway docs
Add docs for using proxy gateways to run multiple workers on remote
machines
2025-01-12 20:36:02 +02:00
Alon Livne
a9a303f688 add proxy gateways with --px arg
Proxy gateways do not run workers, and are meant to be passed with the
`via` attribute to additional gateways.
They are useful for running multiple workers on remote machines.

Example usage:
```
pytest -sv --dist=load --px "id=my_proxy//socket=IP:PORT" --tx "5*popen//via=my_proxy"
```

Proxy gateways do not run workers, anda re meant to be passed
2025-01-12 20:33:31 +02:00
pre-commit-ci[bot]
a82981f444 [pre-commit.ci] pre-commit autoupdate (#1168)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.4 → v0.8.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.4...v0.8.6)
- [github.com/pre-commit/mirrors-mypy: v1.14.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.0...v1.14.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-07 06:23:53 +01:00
pre-commit-ci[bot]
8c6c658f3a [pre-commit.ci] pre-commit autoupdate (#1167)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.8.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.3...v0.8.4)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-24 07:19:37 +01:00
pre-commit-ci[bot]
003d4e0a30 [pre-commit.ci] pre-commit autoupdate (#1166)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.8.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.2...v0.8.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
2024-12-17 09:09:20 -03:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
42d3204015 Merge pull request #1165 from pytest-dev/dependabot/github_actions/github-actions-45e9fa06d3
build(deps): bump hynek/build-and-inspect-python-package from 2.10 to 2.11 in the github-actions group
2024-12-17 02:49:53 +01:00
dependabot[bot]
5c1de86638 build(deps): bump hynek/build-and-inspect-python-package
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.10 to 2.11
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.10...v2.11)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 17:43:16 +00:00
pre-commit-ci[bot]
6eb403d612 [pre-commit.ci] pre-commit autoupdate (#1164)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.1...v0.8.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-10 07:32:14 +01:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
c9dce96b37 Merge pull request #1163 from pytest-dev/dependabot/github_actions/github-actions-088cad1836
build(deps): bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 in the github-actions group
2024-12-09 20:25:38 +01:00
dependabot[bot]
bcf9ebda2d build(deps): bump pypa/gh-action-pypi-publish
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.12.2 to 1.12.3
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.2...v1.12.3)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 17:37:00 +00:00
Bruno Oliveira
39c62b30a4 Drop EOL Python 3.8 support (#1162)
* Drop EOL Python 3.8 support

* Run pyupgrade --py39-plus on all files

* Revert using direct annotations in looponfail.py

We need to use string annotations otherwise we get this error:

```
ValueError: ("the use of non-builtin globals isn't supported", ['execnet', 'Any'])
```
2024-12-07 10:08:45 -03:00
Bruno Oliveira
31bee7c567 Revert using direct annotations in looponfail.py
We need to use string annotations otherwise we get this error:

```
ValueError: ("the use of non-builtin globals isn't supported", ['execnet', 'Any'])
```
2024-12-07 08:57:08 -03:00
Bruno Oliveira
475b346fd9 Run pyupgrade --py39-plus on all files 2024-12-07 08:47:25 -03:00
Bruno Oliveira
6dc8c2a66d Drop EOL Python 3.8 support 2024-12-07 08:47:25 -03:00
pre-commit-ci[bot]
c3d7b7784a [pre-commit.ci] pre-commit autoupdate (#1160)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.0...v0.8.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-02 21:41:02 -03:00
pre-commit-ci[bot]
b4eb2cae8f [pre-commit.ci] pre-commit autoupdate (#1158)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.4...v0.8.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-26 08:59:28 +01:00
pre-commit-ci[bot]
26e3b35f7e [pre-commit.ci] pre-commit autoupdate (#1156)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.7.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.3...v0.7.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-19 07:30:56 +01:00
Ronny Pfannschmidt
65042b05da Merge pull request #1153 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-11-12 06:57:46 +01:00
pre-commit-ci[bot]
aca8dd4a18 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.7.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.2...v0.7.3)
2024-11-11 23:01:32 +00:00
Sviatoslav Sydorenko (Святослав Сидоренко)
7deba63fc8 Merge pull request #1152 from pytest-dev/dependabot/github_actions/github-actions-5da8da3d55 2024-11-11 19:27:53 +01:00
dependabot[bot]
a6d7ec19e2 build(deps): bump pypa/gh-action-pypi-publish
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.11.0 to 1.12.2
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.11.0...v1.12.2)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 17:39:50 +00:00
dependabot[bot]
0910472e2a build(deps): bump the github-actions group with 2 updates (#1149)
Bumps the github-actions group with 2 updates: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `hynek/build-and-inspect-python-package` from 2.9 to 2.10
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.9...v2.10)

Updates `pypa/gh-action-pypi-publish` from 1.10.3 to 1.11.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.3...v1.11.0)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 20:55:10 -03:00
pre-commit-ci[bot]
ec3ce293ef [pre-commit.ci] pre-commit autoupdate (#1150)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.1 → v0.7.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.1...v0.7.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-05 09:34:35 +01:00
Aleksandr Mezin
9788f12e9e Make 'steal' command atomic (#1144)
Either unschedule all requested tests, or none if it's not possible -
if some of the requested tests have already been processed by the time
the request arrives. It may happen if the worker runs tests faster than
the controller receives and processes status updates. But in this case
maybe it's just better to let the worker keep running.

This is a prerequisite for group/scope support in worksteal scheduler -
so they won't be broken up incorrectly.

This change could break schedulers that use "steal" command. However:

1) worksteal scheduler doesn't need any adjustments.

2) I'm not aware of any external schedulers relying on this command yet.

So I think it's better to keep the protocol simple, not complicate it for
imaginary compatibility with some unknown and likely non-existent
schedulers.

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2024-10-30 14:00:10 -03:00
pre-commit-ci[bot]
34c554987a [pre-commit.ci] pre-commit autoupdate (#1147)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.0 → v0.7.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.0...v0.7.1)
- [github.com/asottile/blacken-docs: 1.19.0 → 1.19.1](https://github.com/asottile/blacken-docs/compare/1.19.0...1.19.1)
- [github.com/pre-commit/mirrors-mypy: v1.12.1 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.12.1...v1.13.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-28 22:46:37 -03:00
Sviatoslav Sydorenko (Святослав Сидоренко)
9c24f0fa4a Merge pull request #1143 from pytest-dev/pre-commit-ci-update-config 2024-10-22 01:30:42 +02:00
pre-commit-ci[bot]
def1f883ff [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.9...v0.7.0)
- [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1)
2024-10-21 23:02:01 +00:00
Ronny Pfannschmidt
469f31bc2d Merge pull request #1142 from edgarrmondragon/cp313
Added support for Python 3.13
2024-10-20 11:00:37 +02:00
Edgar Ramírez-Mondragón
3bf62e0e22 Added changelog entry 2024-10-19 08:57:03 -06:00
Edgar Ramírez-Mondragón
1c60dafcb2 Added support for Python 3.13 2024-10-19 08:56:01 -06:00
pre-commit-ci[bot]
a65df239f4 [pre-commit.ci] pre-commit autoupdate (#1137)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.8 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.8...v0.6.9)
- [github.com/asottile/blacken-docs: 1.18.0 → 1.19.0](https://github.com/asottile/blacken-docs/compare/1.18.0...1.19.0)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-08 06:43:26 +02:00
dependabot[bot]
c483298478 build(deps): bump pypa/gh-action-pypi-publish (#1136)
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.10.2 to 1.10.3
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.2...v1.10.3)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 23:02:42 +02:00
pre-commit-ci[bot]
3d1f4b1e04 [pre-commit.ci] pre-commit autoupdate (#1135)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.7 → v0.6.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.7...v0.6.8)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-01 10:31:46 +02:00
pre-commit-ci[bot]
cbbb894e71 [pre-commit.ci] pre-commit autoupdate (#1133)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.5 → v0.6.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.5...v0.6.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-24 06:48:26 +02:00
dependabot[bot]
8b82eafcd4 build(deps): bump pypa/gh-action-pypi-publish (#1132)
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.10.1 to 1.10.2
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 20:02:46 +02:00
pre-commit-ci[bot]
a66354ada5 [pre-commit.ci] pre-commit autoupdate (#1129)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.4 → v0.6.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.4...v0.6.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-17 21:00:47 -03:00
pre-commit-ci[bot]
b05a5bc7b8 [pre-commit.ci] pre-commit autoupdate (#1128)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.6.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 20:28:12 -03:00
dependabot[bot]
38656eacef build(deps): bump the github-actions group with 2 updates (#1127)
Bumps the github-actions group with 2 updates: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `hynek/build-and-inspect-python-package` from 2.8 to 2.9
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.8...v2.9)

Updates `pypa/gh-action-pypi-publish` from 1.10.0 to 1.10.1
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 18:22:54 -03:00
Bruno Oliveira
00231dce72 Publish package with attestations (#1125)
Follow up to https://github.com/pytest-dev/pytest-xdist/pull/1123.
2024-09-04 09:55:16 -03:00
pre-commit-ci[bot]
59866c7281 [pre-commit.ci] pre-commit autoupdate (#1124)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.6.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.2...v0.6.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-02 21:36:55 -03:00
dependabot[bot]
6f0620f559 build(deps): bump pypa/gh-action-pypi-publish (#1123)
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 20:10:40 +02:00
pre-commit-ci[bot]
548280f737 [pre-commit.ci] pre-commit autoupdate (#1120)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.1 → v0.6.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.1...v0.6.2)
- [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.1...v1.11.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-26 23:28:07 -03:00
pre-commit-ci[bot]
5a7e87f06b [pre-commit.ci] pre-commit autoupdate (#1117)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.7...v0.6.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-19 20:34:24 -03:00
pre-commit-ci[bot]
649cca56bb [pre-commit.ci] pre-commit autoupdate (#1116)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.5.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.6...v0.5.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-13 06:24:04 +02:00
pre-commit-ci[bot]
629f3164a9 [pre-commit.ci] pre-commit autoupdate (#1115)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.5...v0.5.6)
- [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.11.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-06 07:10:39 +02:00
dependabot[bot]
4902dc32e9 build(deps): bump hynek/build-and-inspect-python-package (#1112)
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.7 to 2.8
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.7...v2.8)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 12:18:54 -03:00
pre-commit-ci[bot]
e377c3428c [pre-commit.ci] pre-commit autoupdate (#1113)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.5.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.4...v0.5.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-31 22:23:53 -03:00
Ronny Pfannschmidt
224d026e67 Merge pull request #1110 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-07-24 00:12:19 +02:00
Bruno Oliveira
569cb964d3 Adapt to mypy 1.11 2024-07-23 10:05:14 -03:00
pre-commit-ci[bot]
8230e4f1e1 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.2...v0.5.4)
- [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.0)
2024-07-22 22:33:28 +00:00
dependabot[bot]
b417c792f1 build(deps): bump hynek/build-and-inspect-python-package (#1109)
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.6 to 2.7
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.6...v2.7)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 15:35:56 -03:00
pre-commit-ci[bot]
d8efeb9f74 [pre-commit.ci] pre-commit autoupdate (#1105)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-18 09:01:15 -03:00
dependabot[bot]
fabdbe3fd2 build(deps): bump pypa/gh-action-pypi-publish (#1100)
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.8.14 to 1.9.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:41:58 -03:00
pre-commit-ci[bot]
f8eaa1483b [pre-commit.ci] pre-commit autoupdate (#1104)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0)
- [github.com/asottile/blacken-docs: 1.16.0 → 1.18.0](https://github.com/asottile/blacken-docs/compare/1.16.0...1.18.0)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-02 07:55:25 -03:00
pre-commit-ci[bot]
f1ae09176b [pre-commit.ci] pre-commit autoupdate (#1101)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.8 → v0.4.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.8...v0.4.10)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-27 09:27:07 -03:00
pre-commit-ci[bot]
c7b4f61144 [pre-commit.ci] pre-commit autoupdate (#1095)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.7 → v0.4.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.7...v0.4.8)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-10 21:58:13 -03:00
dependabot[bot]
39cb171341 build(deps): bump hynek/build-and-inspect-python-package (#1088)
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.5 to 2.6
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.5...v2.6)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 21:58:00 -03:00
pre-commit-ci[bot]
98f2fc5982 [pre-commit.ci] pre-commit autoupdate (#1079)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.7)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0)

* Ignore "Use format specifiers instead of percent format" ruff error

No reason to force this in old code.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2024-06-04 09:59:02 -03:00
Nick Murphy
6f3f574c90 Clarify error message to indicate that users should refer to the documentation of pytest-xdist (#1092) 2024-06-04 08:50:20 -03:00
dependabot[bot]
7cc6515c06 build(deps): bump hynek/build-and-inspect-python-package (#1082)
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.4 to 2.5
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.4...v2.5)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 07:38:54 -03:00
Ran Benita
e04e4ac30d Merge pull request #1077 from bluetech/tox-tweak
Some tox/build/config tweaks
2024-04-29 10:09:07 +03:00
Ran Benita
64469f56a3 MANIFEST.in: remove
I don't think a few unnecessary dot files bother anyone, and may
arguably be useful to someone.
2024-04-28 22:59:43 +03:00
Ran Benita
7c83841a3d pyproject: remove setuptools include-package-data = false
I compared the sdists and wheels and it makes no difference.
2024-04-28 22:54:31 +03:00
Ran Benita
6d54a6b2e3 pyproject: remove setuptools zip-safe key
According to
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration
it's no longer relevant.
2024-04-28 22:52:30 +03:00
Ran Benita
a9a3d13a29 pyproject: remove setuptools platforms key
According to
https://packaging.python.org/en/latest/specifications/core-metadata/#platform-multiple-use
this is redundant with the classifiers.
2024-04-28 22:51:26 +03:00
Ran Benita
d204fdf965 pyproject: move pytest config from tox.ini 2024-04-28 22:48:51 +03:00
Ran Benita
fb51e6ba20 tox: some cleanups & remove hardcoded python3.10 2024-04-28 22:46:55 +03:00
Ran Benita
c143230d88 Merge pull request #1076 from pytest-dev/release-3.6.1
Release 3.6.1
2024-04-28 22:30:35 +03:00
Ran Benita
4dd2978031 Release 3.6.1 2024-04-28 22:20:45 +03:00
Ran Benita
b397288b7e Merge pull request #1072 from zmedico/gateway-cache-rinfo
Cache execnet gateway rinfo during WorkerController setup
2024-04-28 22:17:03 +03:00
Zac Medico
12b3cce0ce Cache execnet gateway rinfo during WorkerController setup
Cache execnet gateway info during WorkerController setup for backward
compatibility, in order to avoid a later main_thread_only deadlock
error triggered when pytest-cov calls rinfo after the main thread is
already busy. See pytest-dev/execnet#274 for corresponding test case.

Fixes: 20e3ac774e ("Use execnet main_thread_only execmodel (#1027)")
2024-04-28 22:01:32 +03:00
dependabot[bot]
c93a106b3a build(deps): bump hynek/build-and-inspect-python-package (#1066)
Bumps the github-actions group with 1 update: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package).


Updates `hynek/build-and-inspect-python-package` from 2.2 to 2.4
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v2.2...v2.4)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 14:20:59 -03:00
pre-commit-ci[bot]
52e2022638 [pre-commit.ci] pre-commit autoupdate (#1073)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.7 → v0.4.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.7...v0.4.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-23 14:20:44 -03:00
Ran Benita
699f939b5c Merge pull request #1070 from pytest-dev/release-3.6.0
Release 3.6.0
2024-04-19 22:49:28 +03:00
29 changed files with 434 additions and 148 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build and Check Package - name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.2 uses: hynek/build-and-inspect-python-package@v2.13
deploy: deploy:
needs: package needs: package
@@ -39,7 +39,9 @@ jobs:
path: dist path: dist
- name: Publish package to PyPI - name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14 uses: pypa/gh-action-pypi-publish@v1.12.4
with:
attestations: true
- name: Push tag - name: Push tag
run: | run: |

View File

@@ -22,7 +22,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build and Check Package - name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.2 uses: hynek/build-and-inspect-python-package@v2.13
test: test:
@@ -34,22 +34,20 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
tox_env: tox_env:
- "py38-pytestmin" - "py39-pytestmin"
- "py38-pytestlatest"
- "py39-pytestlatest" - "py39-pytestlatest"
- "py310-pytestlatest" - "py310-pytestlatest"
- "py311-pytestlatest" - "py311-pytestlatest"
- "py311-pytestmain" - "py311-pytestmain"
- "py312-pytestlatest" - "py312-pytestlatest"
- "py313-pytestlatest"
- "py310-psutil" - "py310-psutil"
- "py310-setproctitle" - "py310-setproctitle"
os: [ubuntu-latest, windows-latest] os: [ubuntu-latest, windows-latest]
include: include:
- tox_env: "py38-pytestmin" - tox_env: "py39-pytestmin"
python: "3.8" python: "3.9"
- tox_env: "py38-pytestlatest"
python: "3.8"
- tox_env: "py39-pytestlatest" - tox_env: "py39-pytestlatest"
python: "3.9" python: "3.9"
- tox_env: "py310-pytestlatest" - tox_env: "py310-pytestlatest"
@@ -60,6 +58,8 @@ jobs:
python: "3.11" python: "3.11"
- tox_env: "py312-pytestlatest" - tox_env: "py312-pytestlatest"
python: "3.12" python: "3.12"
- tox_env: "py313-pytestlatest"
python: "3.13"
- tox_env: "py310-psutil" - tox_env: "py310-psutil"
python: "3.10" python: "3.10"
- tox_env: "py310-setproctitle" - tox_env: "py310-setproctitle"

View File

@@ -1,17 +1,17 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.7" rev: "v0.12.3"
hooks: hooks:
- id: ruff - id: ruff
args: ["--fix"] args: ["--fix"]
- id: ruff-format - id: ruff-format
- repo: https://github.com/asottile/blacken-docs - repo: https://github.com/asottile/blacken-docs
rev: 1.16.0 rev: 1.19.1
hooks: hooks:
- id: blacken-docs - id: blacken-docs
additional_dependencies: [black==23.1.0] additional_dependencies: [black==23.1.0]
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 rev: v5.0.0
hooks: hooks:
- id: check-yaml - id: check-yaml
- repo: local - repo: local
@@ -23,7 +23,7 @@ repos:
language: python language: python
additional_dependencies: [pygments, restructuredtext_lint] additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0 rev: v1.16.1
hooks: hooks:
- id: mypy - id: mypy
files: ^(src/|testing/) files: ^(src/|testing/)

View File

@@ -1,6 +1,63 @@
pytest-xdist 3.8.0 (2025-06-30)
===============================
Features
--------
- `#1083 <https://github.com/pytest-dev/pytest-xdist/issues/1083>`_: Add ``--no-loadscope-reorder`` and ``--loadscope-reorder`` option to control whether to automatically reorder tests in loadscope for tests where relative ordering matters. This only applies when using ``loadscope``.
For example, [test_file_1, test_file_2, ..., test_file_n] are given as input test files, if ``--no-loadscope-reorder`` is used, for either worker, the ``test_file_a`` will be executed before ``test_file_b`` only if ``a < b``.
The default behavior is to reorder the tests to maximize the number of tests that can be executed in parallel.
pytest-xdist 3.7.0 (2025-05-26)
===============================
Features
--------
- `#1142 <https://github.com/pytest-dev/pytest-xdist/issues/1142>`_: Added support for Python 3.13.
- `#1144 <https://github.com/pytest-dev/pytest-xdist/issues/1144>`_: The internal `steal` command is now atomic - it unschedules either all requested tests or none.
This is a prerequisite for group/scope support in the `worksteal` scheduler, so test groups won't be broken up incorrectly.
- `#1170 <https://github.com/pytest-dev/pytest-xdist/issues/1170>`_: Add the `--px` arg to create proxy gateways.
Proxy gateways are passed to additional gateways using the `via` keyword.
They can serve as a way to run multiple workers on remote machines.
- `#1200 <https://github.com/pytest-dev/pytest-xdist/issues/1200>`_: Now multiple ``xdist_group`` markers are considered when assigning tests to groups (order does not matter).
Previously, only the last marker would assign a test to a group, but now if a test has multiple ``xdist_group`` marks applied (for example via parametrization or via fixtures), they are merged to make a new group.
Removals
--------
- `#1162 <https://github.com/pytest-dev/pytest-xdist/issues/1162>`_: Dropped support for EOL Python 3.8.
Trivial Changes
---------------
- `#1092 <https://github.com/pytest-dev/pytest-xdist/issues/1092>`_: Update an error message to better indicate where users should go for more information.
- `#1190 <https://github.com/pytest-dev/pytest-xdist/issues/1190>`_: Switched to using a SPDX license identifier introduced in PEP 639.
pytest-xdist 3.6.1 (2024-04-28)
===============================
Bug Fixes
---------
- `#1071 <https://github.com/pytest-dev/pytest-xdist/issues/1071>`_: Add backward compatibility for deadlock issue with the ``execnet`` new ``main_thread_only`` "execmodel" triggered when pytest-cov accesses rinfo.
pytest-xdist 3.6.0 (2024-04-19) pytest-xdist 3.6.0 (2024-04-19)
=============================== ===============================
This release was YANKED due to a regression fixed in 3.6.1.
Features Features
-------- --------

View File

@@ -1,5 +0,0 @@
exclude .appveyor.yml
exclude .gitignore
exclude .pre-commit-config.yaml
exclude .travis.yml
prune .github

View File

@@ -19,6 +19,8 @@ if it is not or if it fails to determine the number of logical CPUs, fall back t
Pass a number, e.g. ``-n 8``, to specify the number of processes explicitly. Pass a number, e.g. ``-n 8``, to specify the number of processes explicitly.
Use ``-n 0`` to disable xdist and run all tests in the main process.
To specify a different meaning for ``-n auto`` and ``-n logical`` for your To specify a different meaning for ``-n auto`` and ``-n logical`` for your
tests, you can: tests, you can:
@@ -66,7 +68,10 @@ The test distribution algorithm is configured with the ``--dist`` command-line o
* ``--dist loadgroup``: Tests are grouped by the ``xdist_group`` mark. Groups are * ``--dist loadgroup``: Tests are grouped by the ``xdist_group`` mark. Groups are
distributed to available workers as whole units. This guarantees that all distributed to available workers as whole units. This guarantees that all
tests with same ``xdist_group`` name run in the same worker. tests with same ``xdist_group`` name run in the same worker. If a test has
multiple groups, they will be joined together into a new group,
the order of the marks doesn't matter. This works along with marks from fixtures
and from the pytestmark global variable.
.. code-block:: python .. code-block:: python
@@ -81,6 +86,36 @@ The test distribution algorithm is configured with the ``--dist`` command-line o
pass pass
This will make sure ``test1`` and ``TestA::test2`` will run in the same worker. This will make sure ``test1`` and ``TestA::test2`` will run in the same worker.
.. code-block:: python
@pytest.fixture(
scope="session",
params=[
pytest.param(
"chrome",
marks=pytest.mark.xdist_group("chrome"),
),
pytest.param(
"firefox",
marks=pytest.mark.xdist_group("firefox"),
),
pytest.param(
"edge",
marks=pytest.mark.xdist_group("edge"),
),
],
)
def setup_container():
pass
@pytest.mark.xdist_group(name="data-store")
def test_data_store(setup_container):
...
This will generate 3 new groups: ``chrome_data-store``, ``data-store_firefox`` and ``data-store_edge`` (the markers are lexically sorted before being merged together).
Tests without the ``xdist_group`` mark are distributed normally as in the ``--dist=load`` mode. Tests without the ``xdist_group`` mark are distributed normally as in the ``--dist=load`` mode.
* ``--dist worksteal``: Initially, tests are distributed evenly among all * ``--dist worksteal``: Initially, tests are distributed evenly among all

View File

@@ -66,6 +66,20 @@ new socket host with something like this::
pytest -d --tx socket=192.168.1.102:8888 --rsyncdir mypkg pytest -d --tx socket=192.168.1.102:8888 --rsyncdir mypkg
Using proxies to run multiple workers on remote machines
---------------------------------------
In case you want to run multiple workers on a remote machine,
you can create a proxy gateway for the machine, and run multiple
workers using the `via` attribute.::
pytest -d --px id=my_proxy//socket=192.168.1.102:8888 --tx 5*popen//via=my_proxy
Here we declare a proxy gateway using the `--px` arg, and
create 5 workers that run on the remote server using the proxy.
Note that the proxy gateway does not run a worker, thus only 5
workers are created.
Running tests on many platforms at once Running tests on many platforms at once
--------------------------------------- ---------------------------------------

View File

@@ -1,6 +1,6 @@
[build-system] [build-system]
requires = [ requires = [
"setuptools>=61.2", "setuptools>=77.0",
"setuptools-scm[toml]>=6.2.3", "setuptools-scm[toml]>=6.2.3",
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
@@ -9,13 +9,12 @@ build-backend = "setuptools.build_meta"
name = "pytest-xdist" name = "pytest-xdist"
description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs"
readme = "README.rst" readme = "README.rst"
license = {file="LICENSE"} license = "MIT"
authors = [{name = "holger krekel and contributors", email = "pytest-dev@python.org"}, {email = "holger@merlinux.eu"}] authors = [{name = "holger krekel and contributors", email = "pytest-dev@python.org"}, {email = "holger@merlinux.eu"}]
classifiers = [ classifiers = [
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Framework :: Pytest", "Framework :: Pytest",
"Intended Audience :: Developers", "Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX", "Operating System :: POSIX",
"Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X", "Operating System :: MacOS :: MacOS X",
@@ -25,13 +24,13 @@ classifiers = [
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
] ]
requires-python = ">=3.8" requires-python = ">=3.9"
dependencies = [ dependencies = [
"execnet>=2.1", "execnet>=2.1",
"pytest>=7.0.0", "pytest>=7.0.0",
@@ -54,18 +53,15 @@ testing = ["filelock"]
psutil = ["psutil>=3.0"] psutil = ["psutil>=3.0"]
setproctitle = ["setproctitle"] setproctitle = ["setproctitle"]
[tool.setuptools]
zip-safe = false
platforms = [
"linux",
"osx",
"win32",
]
include-package-data = false
[tool.setuptools_scm] [tool.setuptools_scm]
write_to = "src/xdist/_version.py" write_to = "src/xdist/_version.py"
[tool.pytest.ini_options]
# pytest-services also defines a worker_id fixture, disable
# it so they don't conflict with each other (#611).
addopts = "-ra -p no:pytest-services"
testpaths = ["testing"]
[tool.ruff] [tool.ruff]
src = ["src"] src = ["src"]
@@ -115,6 +111,7 @@ ignore = [
"PLW0120", # remove the else and dedent its contents "PLW0120", # remove the else and dedent its contents
"PLW2901", # for loop variable overwritten by assignment target "PLW2901", # for loop variable overwritten by assignment target
"PLR5501", # Use `elif` instead of `else` then `if` "PLR5501", # Use `elif` instead of `else` then `if`
"UP031", # Use format specifiers instead of percent format
] ]
[tool.ruff.lint.pycodestyle] [tool.ruff.lint.pycodestyle]

View File

@@ -7,8 +7,8 @@ from xdist.plugin import is_xdist_worker
__all__ = [ __all__ = [
"__version__", "__version__",
"is_xdist_worker",
"is_xdist_master",
"is_xdist_controller",
"get_xdist_worker_id", "get_xdist_worker_id",
"is_xdist_controller",
"is_xdist_master",
"is_xdist_worker",
] ]

View File

@@ -1,8 +1,8 @@
from collections.abc import Iterator
from itertools import chain from itertools import chain
import os import os
from pathlib import Path from pathlib import Path
from typing import Callable from typing import Callable
from typing import Iterator
def visit_path( def visit_path(

View File

@@ -1,12 +1,12 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from enum import auto from enum import auto
from enum import Enum from enum import Enum
from queue import Empty from queue import Empty
from queue import Queue from queue import Queue
import sys import sys
from typing import Any from typing import Any
from typing import Sequence
import warnings import warnings
import execnet import execnet

View File

@@ -9,12 +9,12 @@ the controlling process which should best never happen.
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
import os import os
from pathlib import Path from pathlib import Path
import sys import sys
import time import time
from typing import Any from typing import Any
from typing import Sequence
from _pytest._io import TerminalWriter from _pytest._io import TerminalWriter
import execnet import execnet
@@ -166,7 +166,7 @@ def init_worker_session(
import sys import sys
outchannel = channel.gateway.newchannel() outchannel = channel.gateway.newchannel()
sys.stdout = sys.stderr = outchannel.makefile("w") # type: ignore[assignment] sys.stdout = sys.stderr = outchannel.makefile("w")
channel.send(outchannel) channel.send(outchannel)
# prune sys.path to not contain relative paths # prune sys.path to not contain relative paths
newpaths = [] newpaths = []

View File

@@ -14,9 +14,9 @@ must be taken in plugins in case ``xdist`` is not installed. Please see:
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
import os import os
from typing import Any from typing import Any
from typing import Sequence
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import execnet import execnet

View File

@@ -127,6 +127,32 @@ def pytest_addoption(parser: pytest.Parser) -> None:
"(default) no: Run tests inprocess, don't distribute." "(default) no: Run tests inprocess, don't distribute."
), ),
) )
group.addoption(
"--loadscope-reorder",
dest="loadscopereorder",
action="store_true",
default=True,
help=(
"Pytest-xdist will default reorder tests by number of tests per scope "
"when used in conjunction with loadscope.\n"
"This option will enable loadscope reorder which will improve the "
"parallelism of the test suite.\n"
"However, the partial order of tests might not be retained.\n"
),
)
group.addoption(
"--no-loadscope-reorder",
dest="loadscopereorder",
action="store_false",
help=(
"Pytest-xdist will default reorder tests by number of tests per scope "
"when used in conjunction with loadscope.\n"
"This option will disable loadscope reorder, "
"and the partial order of tests can be retained.\n"
"This is useful when pytest-xdist is used together with "
"other plugins that specify tests in a specific order."
),
)
group.addoption( group.addoption(
"--tx", "--tx",
dest="tx", dest="tx",
@@ -139,6 +165,17 @@ def pytest_addoption(parser: pytest.Parser) -> None:
"--tx ssh=user@codespeak.net//chdir=testcache" "--tx ssh=user@codespeak.net//chdir=testcache"
), ),
) )
group.addoption(
"--px",
dest="px",
action="append",
default=[],
metavar="xspec",
help=(
"Add a proxy gateway to pass to test execution environments using `via`. Example:\n"
"--px id=my_proxy//socket=192.168.1.102:8888 --tx 5*popen//via=my_proxy"
),
)
group._addoption( group._addoption(
"-d", "-d",
action="store_true", action="store_true",

View File

@@ -8,16 +8,19 @@ needs not to be installed in remote environments.
from __future__ import annotations from __future__ import annotations
import collections
from collections.abc import Generator
from collections.abc import Iterable
from collections.abc import Sequence
import contextlib import contextlib
import enum import enum
import os import os
import sys import sys
import time import time
from typing import Any from typing import Any
from typing import Generator
from typing import Literal from typing import Literal
from typing import Sequence
from typing import TypedDict from typing import TypedDict
from typing import Union
import warnings import warnings
from _pytest.config import _prepareconfig from _pytest.config import _prepareconfig
@@ -66,7 +69,44 @@ def worker_title(title: str) -> None:
class Marker(enum.Enum): class Marker(enum.Enum):
SHUTDOWN = 0 SHUTDOWN = 0
QUEUE_REPLACED = 1
class TestQueue:
"""A simple queue that can be inspected and modified while the lock is held via the ``lock()`` method."""
Item = Union[int, Literal[Marker.SHUTDOWN]]
def __init__(self, execmodel: execnet.gateway_base.ExecModel):
self._items: collections.deque[TestQueue.Item] = collections.deque()
self._lock = execmodel.RLock() # type: ignore[no-untyped-call]
self._has_items_event = execmodel.Event()
def get(self) -> Item:
while True:
with self.lock() as locked_items:
if locked_items:
return locked_items.popleft()
self._has_items_event.wait()
def put(self, item: Item) -> None:
with self.lock() as locked_items:
locked_items.append(item)
def replace(self, iterable: Iterable[Item]) -> None:
with self.lock():
self._items = collections.deque(iterable)
@contextlib.contextmanager
def lock(self) -> Generator[collections.deque[Item]]:
with self._lock:
try:
yield self._items
finally:
if self._items:
self._has_items_event.set()
else:
self._has_items_event.clear()
class WorkerInteractor: class WorkerInteractor:
@@ -77,22 +117,10 @@ class WorkerInteractor:
self.testrunuid = workerinput["testrunuid"] self.testrunuid = workerinput["testrunuid"]
self.log = Producer(f"worker-{self.workerid}", enabled=config.option.debug) self.log = Producer(f"worker-{self.workerid}", enabled=config.option.debug)
self.channel = channel self.channel = channel
self.torun = self._make_queue() self.torun = TestQueue(self.channel.gateway.execmodel)
self.nextitem_index: int | None | Literal[Marker.SHUTDOWN] = None self.nextitem_index: int | None | Literal[Marker.SHUTDOWN] = None
config.pluginmanager.register(self) config.pluginmanager.register(self)
def _make_queue(self) -> Any:
return self.channel.gateway.execmodel.queue.Queue()
def _get_next_item_index(self) -> int | Literal[Marker.SHUTDOWN]:
"""Gets the next item from test queue. Handles the case when the queue
is replaced concurrently in another thread.
"""
result = self.torun.get()
while result is Marker.QUEUE_REPLACED:
result = self.torun.get()
return result # type: ignore[no-any-return]
def sendevent(self, name: str, **kwargs: object) -> None: def sendevent(self, name: str, **kwargs: object) -> None:
self.log("sending", name, kwargs) self.log("sending", name, kwargs)
self.channel.send((name, kwargs)) self.channel.send((name, kwargs))
@@ -146,30 +174,34 @@ class WorkerInteractor:
self.steal(kwargs["indices"]) self.steal(kwargs["indices"])
def steal(self, indices: Sequence[int]) -> None: def steal(self, indices: Sequence[int]) -> None:
indices_set = set(indices) """
stolen = [] Remove tests from the queue.
old_queue, self.torun = self.torun, self._make_queue() Removes either all requested tests, or none, if some of these tests
are not in the queue (for example, if they were processed already).
def old_queue_get_nowait_noraise() -> int | None: :param indices: indices of the tests to remove.
with contextlib.suppress(self.channel.gateway.execmodel.queue.Empty): """
return old_queue.get_nowait() # type: ignore[no-any-return] requested_set = set(indices)
return None
for i in iter(old_queue_get_nowait_noraise, None): with self.torun.lock() as locked_queue:
if i in indices_set: stolen = list(item for item in locked_queue if item in requested_set)
stolen.append(i)
# Stealing only if all requested tests are still pending
if len(stolen) == len(requested_set):
self.torun.replace(
item for item in locked_queue if item not in requested_set
)
else: else:
self.torun.put(i) stolen = []
self.sendevent("unscheduled", indices=stolen) self.sendevent("unscheduled", indices=stolen)
old_queue.put(Marker.QUEUE_REPLACED)
@pytest.hookimpl @pytest.hookimpl
def pytest_runtestloop(self, session: pytest.Session) -> bool: def pytest_runtestloop(self, session: pytest.Session) -> bool:
self.log("entering main loop") self.log("entering main loop")
self.channel.setcallback(self.handle_command, endmarker=Marker.SHUTDOWN) self.channel.setcallback(self.handle_command, endmarker=Marker.SHUTDOWN)
self.nextitem_index = self._get_next_item_index() self.nextitem_index = self.torun.get()
while self.nextitem_index is not Marker.SHUTDOWN: while self.nextitem_index is not Marker.SHUTDOWN:
self.run_one_test() self.run_one_test()
if session.shouldfail or session.shouldstop: if session.shouldfail or session.shouldstop:
@@ -179,7 +211,7 @@ class WorkerInteractor:
def run_one_test(self) -> None: def run_one_test(self) -> None:
assert isinstance(self.nextitem_index, int) assert isinstance(self.nextitem_index, int)
self.item_index = self.nextitem_index self.item_index = self.nextitem_index
self.nextitem_index = self._get_next_item_index() self.nextitem_index = self.torun.get()
items = self.session.items items = self.session.items
item = items[self.item_index] item = items[self.item_index]
@@ -209,15 +241,17 @@ class WorkerInteractor:
# add the group name to nodeid as suffix if --dist=loadgroup # add the group name to nodeid as suffix if --dist=loadgroup
if config.getvalue("loadgroup"): if config.getvalue("loadgroup"):
for item in items: for item in items:
mark = item.get_closest_marker("xdist_group") gnames: set[str] = set()
if not mark: for mark in item.iter_markers("xdist_group"):
name = (
mark.args[0]
if len(mark.args) > 0
else mark.kwargs.get("name", "default")
)
gnames.add(str(name))
if not gnames:
continue continue
gname = ( item._nodeid = f"{item.nodeid}@{'_'.join(sorted(gnames))}"
mark.args[0]
if len(mark.args) > 0
else mark.kwargs.get("name", "default")
)
item._nodeid = f"{item.nodeid}@{gname}"
@pytest.hookimpl @pytest.hookimpl
def pytest_collection_finish(self, session: pytest.Session) -> None: def pytest_collection_finish(self, session: pytest.Session) -> None:

View File

@@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from difflib import unified_diff from difflib import unified_diff
from typing import Sequence
def report_collection_diff( def report_collection_diff(
@@ -23,7 +23,8 @@ def report_collection_diff(
"Different tests were collected between {from_id} and {to_id}. " "Different tests were collected between {from_id} and {to_id}. "
"The difference is:\n" "The difference is:\n"
"{diff}\n" "{diff}\n"
"To see why this happens see Known limitations in documentation" "To see why this happens see 'Known limitations' in documentation "
"for pytest-xdist"
).format(from_id=from_id, to_id=to_id, diff="\n".join(diff)) ).format(from_id=from_id, to_id=to_id, diff="\n".join(diff))
msg = "\n".join(x.rstrip() for x in error_message.split("\n")) msg = "\n".join(x.rstrip() for x in error_message.split("\n"))
return msg return msg

View File

@@ -1,12 +1,12 @@
from __future__ import annotations from __future__ import annotations
from typing import Sequence from collections.abc import Sequence
import pytest import pytest
from xdist.remote import Producer from xdist.remote import Producer
from xdist.report import report_collection_diff from xdist.report import report_collection_diff
from xdist.workermanage import parse_spec_config from xdist.workermanage import parse_tx_spec_config
from xdist.workermanage import WorkerController from xdist.workermanage import WorkerController
@@ -26,7 +26,7 @@ class EachScheduling:
def __init__(self, config: pytest.Config, log: Producer | None = None) -> None: def __init__(self, config: pytest.Config, log: Producer | None = None) -> None:
self.config = config self.config = config
self.numnodes = len(parse_spec_config(config)) self.numnodes = len(parse_tx_spec_config(config))
self.node2collection: dict[WorkerController, list[str]] = {} self.node2collection: dict[WorkerController, list[str]] = {}
self.node2pending: dict[WorkerController, list[int]] = {} self.node2pending: dict[WorkerController, list[int]] = {}
self._started: list[WorkerController] = [] self._started: list[WorkerController] = []

View File

@@ -1,13 +1,13 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from itertools import cycle from itertools import cycle
from typing import Sequence
import pytest import pytest
from xdist.remote import Producer from xdist.remote import Producer
from xdist.report import report_collection_diff from xdist.report import report_collection_diff
from xdist.workermanage import parse_spec_config from xdist.workermanage import parse_tx_spec_config
from xdist.workermanage import WorkerController from xdist.workermanage import WorkerController
@@ -58,7 +58,7 @@ class LoadScheduling:
""" """
def __init__(self, config: pytest.Config, log: Producer | None = None) -> None: def __init__(self, config: pytest.Config, log: Producer | None = None) -> None:
self.numnodes = len(parse_spec_config(config)) self.numnodes = len(parse_tx_spec_config(config))
self.node2collection: dict[WorkerController, list[str]] = {} self.node2collection: dict[WorkerController, list[str]] = {}
self.node2pending: dict[WorkerController, list[int]] = {} self.node2pending: dict[WorkerController, list[int]] = {}
self.pending: list[int] = [] self.pending: list[int] = []

View File

@@ -1,14 +1,14 @@
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict
from collections.abc import Sequence
from typing import NoReturn from typing import NoReturn
from typing import Sequence
import pytest import pytest
from xdist.remote import Producer from xdist.remote import Producer
from xdist.report import report_collection_diff from xdist.report import report_collection_diff
from xdist.workermanage import parse_spec_config from xdist.workermanage import parse_tx_spec_config
from xdist.workermanage import WorkerController from xdist.workermanage import WorkerController
@@ -91,7 +91,7 @@ class LoadScopeScheduling:
""" """
def __init__(self, config: pytest.Config, log: Producer | None = None) -> None: def __init__(self, config: pytest.Config, log: Producer | None = None) -> None:
self.numnodes = len(parse_spec_config(config)) self.numnodes = len(parse_tx_spec_config(config))
self.collection: list[str] | None = None self.collection: list[str] | None = None
self.workqueue: OrderedDict[str, dict[str, bool]] = OrderedDict() self.workqueue: OrderedDict[str, dict[str, bool]] = OrderedDict()
@@ -371,11 +371,15 @@ class LoadScopeScheduling:
work_unit = unsorted_workqueue.setdefault(scope, {}) work_unit = unsorted_workqueue.setdefault(scope, {})
work_unit[nodeid] = False work_unit[nodeid] = False
# Insert tests scopes into work queue ordered by number of tests. if self.config.option.loadscopereorder:
for scope, nodeids in sorted( # Insert tests scopes into work queue ordered by number of tests.
unsorted_workqueue.items(), key=lambda item: -len(item[1]) for scope, nodeids in sorted(
): unsorted_workqueue.items(), key=lambda item: -len(item[1])
self.workqueue[scope] = nodeids ):
self.workqueue[scope] = nodeids
else:
for scope, nodeids in unsorted_workqueue.items():
self.workqueue[scope] = nodeids
# Avoid having more workers than work # Avoid having more workers than work
extra_nodes = len(self.nodes) - len(self.workqueue) extra_nodes = len(self.nodes) - len(self.workqueue)

View File

@@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from typing import Protocol from typing import Protocol
from typing import Sequence
from xdist.workermanage import WorkerController from xdist.workermanage import WorkerController

View File

@@ -1,13 +1,13 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from typing import NamedTuple from typing import NamedTuple
from typing import Sequence
import pytest import pytest
from xdist.remote import Producer from xdist.remote import Producer
from xdist.report import report_collection_diff from xdist.report import report_collection_diff
from xdist.workermanage import parse_spec_config from xdist.workermanage import parse_tx_spec_config
from xdist.workermanage import WorkerController from xdist.workermanage import WorkerController
@@ -65,7 +65,7 @@ class WorkStealingScheduling:
""" """
def __init__(self, config: pytest.Config, log: Producer | None = None) -> None: def __init__(self, config: pytest.Config, log: Producer | None = None) -> None:
self.numnodes = len(parse_spec_config(config)) self.numnodes = len(parse_tx_spec_config(config))
self.node2collection: dict[WorkerController, list[str]] = {} self.node2collection: dict[WorkerController, list[str]] = {}
self.node2pending: dict[WorkerController, list[int]] = {} self.node2pending: dict[WorkerController, list[int]] = {}
self.pending: list[int] = [] self.pending: list[int] = []

View File

@@ -1,5 +1,7 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from concurrent.futures import ThreadPoolExecutor
import enum import enum
import fnmatch import fnmatch
import os import os
@@ -9,7 +11,6 @@ import sys
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import Literal from typing import Literal
from typing import Sequence
from typing import Union from typing import Union
import uuid import uuid
import warnings import warnings
@@ -23,7 +24,7 @@ from xdist.remote import Producer
from xdist.remote import WorkerInfo from xdist.remote import WorkerInfo
def parse_spec_config(config: pytest.Config) -> list[str]: def parse_tx_spec_config(config: pytest.Config) -> list[str]:
xspeclist = [] xspeclist = []
tx: list[str] = config.getvalue("tx") tx: list[str] = config.getvalue("tx")
for xspec in tx: for xspec in tx:
@@ -57,8 +58,17 @@ class NodeManager:
if self.testrunuid is None: if self.testrunuid is None:
self.testrunuid = uuid.uuid4().hex self.testrunuid = uuid.uuid4().hex
self.group = execnet.Group(execmodel="main_thread_only") self.group = execnet.Group(execmodel="main_thread_only")
for proxy_spec in self._getpxspecs():
# Proxy gateways do not run workers, and are meant to be passed with the `via` attribute
# to additional gateways.
# They are useful for running multiple workers on remote machines.
if getattr(proxy_spec, "id", None) is None:
raise pytest.UsageError(
f"Proxy gateway {proxy_spec} must include an id"
)
self.group.makegateway(proxy_spec)
if specs is None: if specs is None:
specs = self._getxspecs() specs = self._gettxspecs()
self.specs: list[execnet.XSpec] = [] self.specs: list[execnet.XSpec] = []
for spec in specs: for spec in specs:
if not isinstance(spec, execnet.XSpec): if not isinstance(spec, execnet.XSpec):
@@ -85,15 +95,23 @@ class NodeManager:
) -> list[WorkerController]: ) -> list[WorkerController]:
self.config.hook.pytest_xdist_setupnodes(config=self.config, specs=self.specs) self.config.hook.pytest_xdist_setupnodes(config=self.config, specs=self.specs)
self.trace("setting up nodes") self.trace("setting up nodes")
return [self.setup_node(spec, putevent) for spec in self.specs] with ThreadPoolExecutor(max_workers=len(self.specs)) as executor:
futs = [
executor.submit(self.setup_node, spec, putevent, idx)
for idx, spec in enumerate(self.specs)
]
return [f.result() for f in futs]
def setup_node( def setup_node(
self, self,
spec: execnet.XSpec, spec: execnet.XSpec,
putevent: Callable[[tuple[str, dict[str, Any]]], None], putevent: Callable[[tuple[str, dict[str, Any]]], None],
idx: int | None = None,
) -> WorkerController: ) -> WorkerController:
if getattr(spec, "execmodel", None) != "main_thread_only": if getattr(spec, "execmodel", None) != "main_thread_only":
spec = execnet.XSpec(f"execmodel=main_thread_only//{spec}") spec = execnet.XSpec(f"execmodel=main_thread_only//{spec}")
if idx is not None:
spec = execnet.XSpec(f"{spec}//id=gw{idx}")
gw = self.group.makegateway(spec) gw = self.group.makegateway(spec)
self.config.hook.pytest_xdist_newgateway(gateway=gw) self.config.hook.pytest_xdist_newgateway(gateway=gw)
self.rsync_roots(gw) self.rsync_roots(gw)
@@ -107,8 +125,11 @@ class NodeManager:
def teardown_nodes(self) -> None: def teardown_nodes(self) -> None:
self.group.terminate(self.EXIT_TIMEOUT) self.group.terminate(self.EXIT_TIMEOUT)
def _getxspecs(self) -> list[execnet.XSpec]: def _gettxspecs(self) -> list[execnet.XSpec]:
return [execnet.XSpec(x) for x in parse_spec_config(self.config)] return [execnet.XSpec(x) for x in parse_tx_spec_config(self.config)]
def _getpxspecs(self) -> list[execnet.XSpec]:
return [execnet.XSpec(x) for x in self.config.getoption("px")]
def _getrsyncdirs(self) -> list[Path]: def _getrsyncdirs(self) -> list[Path]:
for spec in self.specs: for spec in self.specs:
@@ -312,6 +333,11 @@ class WorkerController:
def setup(self) -> None: def setup(self) -> None:
self.log("setting up worker session") self.log("setting up worker session")
# Cache rinfo for backward compatibility, since pytest-cov
# accesses rinfo while the main thread is busy executing our
# remote_exec call, which triggers a deadlock error for the
# main_thread_only execmodel if the rinfo has not been cached.
self.gateway._rinfo()
spec = self.gateway.spec spec = self.gateway.spec
args = [str(x) for x in self.config.invocation_params.args or ()] args = [str(x) for x in self.config.invocation_params.args or ()]
option_dict = {} option_dict = {}

View File

@@ -1254,6 +1254,24 @@ class TestLoadScope:
"test_b.py::test", result.outlines "test_b.py::test", result.outlines
) == {"gw0": 20} ) == {"gw0": 20}
def test_workqueue_ordered_by_input(self, pytester: pytest.Pytester) -> None:
test_file = """
import pytest
@pytest.mark.parametrize('i', range({}))
def test(i):
pass
"""
pytester.makepyfile(test_a=test_file.format(10), test_b=test_file.format(20))
result = pytester.runpytest(
"-n2", "--dist=loadscope", "--no-loadscope-reorder", "-v"
)
assert get_workers_and_test_count_by_prefix(
"test_a.py::test", result.outlines
) == {"gw0": 10}
assert get_workers_and_test_count_by_prefix(
"test_b.py::test", result.outlines
) == {"gw1": 20}
def test_module_single_start(self, pytester: pytest.Pytester) -> None: def test_module_single_start(self, pytester: pytest.Pytester) -> None:
"""Fix test suite never finishing in case all workers start with a single test (#277).""" """Fix test suite never finishing in case all workers start with a single test (#277)."""
test_file1 = """ test_file1 = """
@@ -1481,6 +1499,46 @@ class TestGroupScope:
assert a_1.keys() == b_1.keys() and a_2.keys() == b_2.keys() assert a_1.keys() == b_1.keys() and a_2.keys() == b_2.keys()
def test_multiple_group_marks(self, pytester: pytest.Pytester) -> None:
test_file = """
import pytest
@pytest.mark.xdist_group(name="group1")
@pytest.mark.xdist_group(name="group2")
def test_1():
pass
"""
pytester.makepyfile(test_a=test_file, test_b=test_file)
result = pytester.runpytest("-n2", "--dist=loadgroup", "-v")
res = parse_tests_and_workers_from_output(result.outlines)
assert len(res) == 2
# get test names
a_1 = next(t[2] for t in res if "test_a.py::test_1" in t[2])
b_1 = next(t[2] for t in res if "test_b.py::test_1" in t[2])
# check groups
assert a_1.split("@")[1] == b_1.split("@")[1] == "group1_group2"
def test_multiple_group_order(self, pytester: pytest.Pytester) -> None:
test_file = """
import pytest
@pytest.mark.xdist_group(name="b")
@pytest.mark.xdist_group(name="d")
@pytest.mark.xdist_group(name="c")
@pytest.mark.xdist_group(name="c2")
@pytest.mark.xdist_group(name="a")
@pytest.mark.xdist_group(name="aa")
def test_1():
pass
"""
pytester.makepyfile(test_a=test_file, test_b=test_file)
result = pytester.runpytest("-n2", "--dist=loadgroup", "-v")
res = parse_tests_and_workers_from_output(result.outlines)
assert len(res) == 2
# get test names
a_1 = next(t[2] for t in res if "test_a.py::test_1" in t[2])
b_1 = next(t[2] for t in res if "test_b.py::test_1" in t[2])
# check groups, order should be sorted
assert a_1.split("@")[1] == b_1.split("@")[1] == "a_aa_b_c_c2_d"
class TestLocking: class TestLocking:
_test_content = """ _test_content = """

View File

@@ -1,8 +1,8 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Generator
import shutil import shutil
from typing import Callable from typing import Callable
from typing import Generator
import execnet import execnet
import pytest import pytest
@@ -12,7 +12,7 @@ pytest_plugins = "pytester"
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]: def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None]:
import atexit import atexit
finalizers = [] finalizers = []

View File

@@ -1,8 +1,8 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence
from typing import Any from typing import Any
from typing import cast from typing import cast
from typing import Sequence
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import execnet import execnet
@@ -543,7 +543,8 @@ def test_report_collection_diff_different() -> None:
"+XXX\n" "+XXX\n"
" ccc\n" " ccc\n"
"-YYY\n" "-YYY\n"
"To see why this happens see Known limitations in documentation" "To see why this happens see 'Known limitations' in documentation "
"for pytest-xdist"
) )
msg = report_collection_diff(from_collection, to_collection, "1", "2") msg = report_collection_diff(from_collection, to_collection, "1", "2")

View File

@@ -295,7 +295,7 @@ class TestDistOptions:
def test_getxspecs(self, pytester: pytest.Pytester) -> None: def test_getxspecs(self, pytester: pytest.Pytester) -> None:
config = pytester.parseconfigure("--tx=popen", "--tx", "ssh=xyz") config = pytester.parseconfigure("--tx=popen", "--tx", "ssh=xyz")
nodemanager = NodeManager(config) nodemanager = NodeManager(config)
xspecs = nodemanager._getxspecs() xspecs = nodemanager._gettxspecs()
assert len(xspecs) == 2 assert len(xspecs) == 2
print(xspecs) print(xspecs)
assert xspecs[0].popen assert xspecs[0].popen
@@ -303,7 +303,7 @@ class TestDistOptions:
def test_xspecs_multiplied(self, pytester: pytest.Pytester) -> None: def test_xspecs_multiplied(self, pytester: pytest.Pytester) -> None:
config = pytester.parseconfigure("--tx=3*popen") config = pytester.parseconfigure("--tx=3*popen")
xspecs = NodeManager(config)._getxspecs() xspecs = NodeManager(config)._gettxspecs()
assert len(xspecs) == 3 assert len(xspecs) == 3
assert xspecs[1].popen assert xspecs[1].popen

View File

@@ -7,7 +7,6 @@ import sys
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import cast from typing import cast
from typing import Dict
from typing import Union from typing import Union
import uuid import uuid
@@ -90,7 +89,7 @@ def worker(request: pytest.FixtureRequest, pytester: pytest.Pytester) -> WorkerS
class TestWorkerInteractor: class TestWorkerInteractor:
UnserializerReport = Callable[ UnserializerReport = Callable[
[Dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport] [dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
] ]
@pytest.fixture @pytest.fixture
@@ -267,6 +266,12 @@ class TestWorkerInteractor:
worker.sendcommand("steal", indices=[1, 2]) worker.sendcommand("steal", indices=[1, 2])
ev = worker.popevent("unscheduled") ev = worker.popevent("unscheduled")
# Cannot steal index 1 because it is completed already, so do not steal any.
assert ev.kwargs["indices"] == []
# Index 2 can be stolen, as it is still pending.
worker.sendcommand("steal", indices=[2])
ev = worker.popevent("unscheduled")
assert ev.kwargs["indices"] == [2] assert ev.kwargs["indices"] == [2]
reports = [ reports = [

View File

@@ -82,11 +82,19 @@ class TestNodeManagerPopen:
call = hookrecorder.popcall("pytest_xdist_setupnodes") call = hookrecorder.popcall("pytest_xdist_setupnodes")
assert len(call.specs) == 2 assert len(call.specs) == 2
call = hookrecorder.popcall("pytest_xdist_newgateway") # check expected gateways
assert call.gateway.spec == execnet.XSpec("execmodel=main_thread_only//popen") gw_calls = [
assert call.gateway.id == "gw0" hookrecorder.popcall("pytest_xdist_newgateway"),
call = hookrecorder.popcall("pytest_xdist_newgateway") hookrecorder.popcall("pytest_xdist_newgateway"),
assert call.gateway.id == "gw1" ]
assert {c.gateway.id for c in gw_calls} == {"gw0", "gw1"}
for c in gw_calls:
expected_spec = execnet.XSpec(
f"execmodel=main_thread_only//popen//id={c.gateway.id}"
)
assert c.gateway.spec == expected_spec
assert len(hm.group) == 2 assert len(hm.group) == 2
hm.teardown_nodes() hm.teardown_nodes()
assert not len(hm.group) assert not len(hm.group)
@@ -206,8 +214,8 @@ class TestNodeManager:
p = Path(p) p = Path(p)
print("remote curdir", p) print("remote curdir", p)
assert p == dest.joinpath(config.rootpath.name) assert p == dest.joinpath(config.rootpath.name)
assert p.joinpath("dir1").check() assert p.joinpath("dir1").is_dir()
assert p.joinpath("dir1", "file1").check() assert p.joinpath("dir1", "file1").is_file()
def test_popen_rsync_subdir( def test_popen_rsync_subdir(
self, self,
@@ -368,6 +376,34 @@ class TestNodeManager:
(rep,) = reprec.getreports("pytest_runtest_logreport") (rep,) = reprec.getreports("pytest_runtest_logreport")
assert rep.passed assert rep.passed
def test_proxy_gateway_setup_nodes(self, pytester: pytest.Pytester) -> None:
nodemanager = NodeManager(
pytester.parseconfig(
"--px", "popen//id=my_proxy", "--tx", "popen//via=my_proxy"
)
)
nodes = nodemanager.setup_nodes(None) # type: ignore[arg-type]
# Proxy gateways are considered as an execnet gateway
assert len(nodemanager.group) == 2
# Proxy gateways do not run workers
assert len(nodes) == 1
def test_proxy_gateway(self, pytester: pytest.Pytester) -> None:
pytester.makepyfile(
__init__="",
test_x="""
def test_one():
pass
""",
)
reprec = pytester.inline_run(
"-d", "--px", "popen//id=my_proxy", "--tx", "popen//via=my_proxy"
)
rep = reprec.getreports("pytest_runtest_logreport")
assert rep[1].passed
class MyWarning(UserWarning): class MyWarning(UserWarning):
pass pass

40
tox.ini
View File

@@ -1,34 +1,26 @@
[tox] [tox]
envlist= envlist =
linting linting
py{38,39,310,311,312}-pytestlatest py{39,310,311,312,313}-pytestlatest
py310-pytestmain py310-pytestmain
py310-psutil py310-psutil
py310-setproctitle py310-setproctitle
isolated_build = true isolated_build = true
[testenv] [testenv]
extras = testing extras =
testing
psutil: psutil
setproctitle: setproctitle
deps = deps =
pytestmin: pytest==7.0.0 pytestmin: pytest==7.0.0
pytestlatest: pytest pytestlatest: pytest
pytestmain: git+https://github.com/pytest-dev/pytest.git pytestmain: git+https://github.com/pytest-dev/pytest.git
commands=
pytest {posargs}
[testenv:py310-psutil]
extras =
testing
psutil
commands = commands =
pytest {posargs:-k psutil} pytest {posargs:{env:_XDIST_TOX_DEFAULT_POSARGS:}}
setenv =
[testenv:py310-setproctitle] _XDIST_TOX_DEFAULT_POSARGS={env:_XDIST_TOX_POSARGS_PSUTIL:}
extras = psutil: _XDIST_TOX_POSARGS_PSUTIL=-k psutil
testing
setproctitle
deps = pytest
commands =
pytest {posargs}
[testenv:linting] [testenv:linting]
skip_install = True skip_install = True
@@ -39,9 +31,8 @@ deps =
commands = pre-commit run --all-files --show-diff-on-failure commands = pre-commit run --all-files --show-diff-on-failure
[testenv:release] [testenv:release]
changedir= changedir =
description = do a release, required posarg of the version number description = do a release, required posarg of the version number
basepython = python3.10
skipsdist = True skipsdist = True
usedevelop = True usedevelop = True
passenv = * passenv = *
@@ -51,16 +42,9 @@ commands =
towncrier build --version {posargs} --yes towncrier build --version {posargs} --yes
[testenv:docs] [testenv:docs]
basepython = python3.10
usedevelop = True usedevelop = True
deps = deps =
sphinx sphinx
sphinx_rtd_theme sphinx_rtd_theme
commands = commands =
sphinx-build -W --keep-going -b html docs docs/_build/html {posargs:} sphinx-build -W --keep-going -b html docs docs/_build/html {posargs:}
[pytest]
# pytest-services also defines a worker_id fixture, disable
# it so they don't conflict with each other (#611).
addopts = -ra -p no:pytest-services
testpaths = testing