Skip to content

Commit f2d5ff0

Browse files
authored
Merge pull request #203 from realpython/types
Update the tests
2 parents 4479cb7 + 3b03511 commit f2d5ff0

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎tests/test_pytest_mypy.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def test_mypy_encoding_warnings(testdir, monkeypatch):
8383
# Use typing.TypedDict or typing_extensions.TypedDict instead.
8484
# https://github.com/python/mypy/pull/15494
8585
expected_warnings += 1
86+
elif MYPY_VERSION >= Version("2.4"):
87+
# https://github.com/python/mypy/pull/21823
88+
expected_warnings -= 1
8689
result.assert_outcomes(passed=mypy_checks, warnings=expected_warnings)
8790

8891

‎tox.ini‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ envlist =
77
py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
88
py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
99
py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
10-
py314-pytest{9.0, 9.x}-mypy{2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
10+
py314-pytest{ 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{ 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
1111
static
1212
publish
1313

1414
[gh-actions]
1515
python =
16-
3.10: py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
16+
3.10: py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}, static, publish
1717
3.11: py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
18-
3.12: py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}, static, publish
18+
3.12: py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
1919
3.13: py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
20-
3.14: py314-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
20+
3.14: py314-pytest{ 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{ 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
2121

2222
[testenv]
2323
constrain_package_deps = true
@@ -37,6 +37,11 @@ deps =
3737
xdist3.0: pytest-xdist ~= 3.0.0
3838
xdist3.x: pytest-xdist ~= 3.0
3939

40+
; xdist implicitly relied on pytest-forked for the py package until 3.0.2 (https://github.com/pytest-dev/pytest-xdist/pull/821).
41+
; pytest-forked removed the dependency on py in 1.7.0, though, leading to a ModuleNotFoundError.
42+
xdist2.0: py ~= 1.11
43+
xdist2.x: py ~= 1.11
44+
4045
packaging ~= 26.2
4146
pytest-cov ~= 5.0.0
4247
pytest-randomly ~= 3.15
@@ -58,7 +63,6 @@ commands =
5863
twine {posargs:check} {envtmpdir}/*
5964

6065
[testenv:static]
61-
basepython = py312 # pytest.Node.from_parent uses typing.Self
6266
deps =
6367
bandit ~= 1.9.0
6468
black ~= 26.5.0

0 commit comments

Comments
 (0)