Skip to content

Commit 6879ffd

Browse files
authored
Move pytest-mypy-plugins tests into mypy jobs (#1447)
* Move pytest-mypy-plugins tests into mypy jobs Those tests are very slow and break under pytest-xdist. * Apply Coverage 7.10 feature * it's a list!
1 parent 937b1e2 commit 6879ffd

File tree

3 files changed

+47
-38
lines changed

3 files changed

+47
-38
lines changed

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-att
3737

3838

3939
[dependency-groups]
40-
tests-mypy = ['pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10"']
40+
mypy = [
41+
{ include-group = "tests" },
42+
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10"'
43+
]
4144
tests = [
42-
{ include-group = "tests-mypy" },
4345
# For regression test to ensure cloudpickle compat doesn't break.
4446
'cloudpickle; platform_python_implementation == "CPython"',
4547
"hypothesis",
4648
"pympler",
4749
"pytest",
50+
"pytest-xdist[psutil]",
4851
]
4952
cov = [
5053
{ include-group = "tests" },
@@ -162,6 +165,7 @@ filterwarnings = ["once::Warning", "ignore:::pympler[.*]"]
162165
[tool.coverage.run]
163166
parallel = true
164167
branch = true
168+
patch = ["subprocess"]
165169
source_pkgs = ["attr", "attrs"]
166170

167171
[tool.coverage.paths]

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ package = wheel
2121
wheel_build_env = .pkg
2222
dependency_groups =
2323
tests: tests
24-
mypy: tests-mypy
24+
mypy: mypy
2525
commands =
26-
tests: pytest {posargs}
26+
tests: pytest {posargs:-n auto}
27+
mypy: pytest -k test_mypy
2728
mypy: mypy tests/typing_example.py
2829
mypy: mypy src/attrs/__init__.pyi src/attr/__init__.pyi src/attr/_typing_compat.pyi src/attr/_version_info.pyi src/attr/converters.pyi src/attr/exceptions.pyi src/attr/filters.pyi src/attr/setters.pyi src/attr/validators.pyi
2930

@@ -39,7 +40,7 @@ set_env =
3940
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
4041
PYTHONWARNINGS=d
4142
commands =
42-
coverage run -m pytest {posargs}
43+
coverage run -m pytest {posargs:-n auto}
4344

4445
[testenv:coverage-report]
4546
# Keep base_python in-sync with .python-version-default

uv.lock

Lines changed: 37 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)