Skip to content

Commit c9d473b

Browse files
committed
mypy: install pytest alongside mypy to get its types
1 parent b893cb3 commit c9d473b

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

Diff for: requirements/mypy.in

+3
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33

44
-c pins.pip
55

6+
# So that we have pytest types.
7+
-r pytest.pip
8+
69
mypy

Diff for: requirements/mypy.pip

+87-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,51 @@
44
#
55
# make upgrade
66
#
7+
attrs==22.2.0 \
8+
--hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 \
9+
--hash=sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99
10+
# via
11+
# -r requirements/pytest.pip
12+
# hypothesis
13+
# pytest
14+
colorama==0.4.6 \
15+
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
16+
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
17+
# via -r requirements/pytest.pip
18+
exceptiongroup==1.1.0 \
19+
--hash=sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e \
20+
--hash=sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23
21+
# via
22+
# -r requirements/pytest.pip
23+
# hypothesis
24+
# pytest
25+
execnet==1.9.0 \
26+
--hash=sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5 \
27+
--hash=sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142
28+
# via
29+
# -r requirements/pytest.pip
30+
# pytest-xdist
31+
flaky==3.7.0 \
32+
--hash=sha256:3ad100780721a1911f57a165809b7ea265a7863305acb66708220820caf8aa0d \
33+
--hash=sha256:d6eda73cab5ae7364504b7c44670f70abed9e75f77dd116352f662817592ec9c
34+
# via -r requirements/pytest.pip
35+
hypothesis==6.62.0 \
36+
--hash=sha256:76f1141e8237f6dd0780a171bec5d6aec873208ccc27b5f9753d4cccd8904272 \
37+
--hash=sha256:e250da77878460f74b53039493a7a18d6fc137b0b77791b382b6a0f4ada9144e
38+
# via -r requirements/pytest.pip
39+
importlib-metadata==6.0.0 \
40+
--hash=sha256:7efb448ec9a5e313a57655d35aa54cd3e01b7e1fbcf72dce1bf06119420f5bad \
41+
--hash=sha256:e354bedeb60efa6affdcc8ae121b73544a7aa74156d047311948f6d711cd378d
42+
# via
43+
# -r requirements/pytest.pip
44+
# pluggy
45+
# pytest
46+
iniconfig==2.0.0 \
47+
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
48+
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
49+
# via
50+
# -r requirements/pytest.pip
51+
# pytest
752
mypy==0.991 \
853
--hash=sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d \
954
--hash=sha256:0c8f3be99e8a8bd403caa8c03be619544bc2c77a7093685dcf308c6b109426c6 \
@@ -40,10 +85,41 @@ mypy-extensions==0.4.3 \
4085
--hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \
4186
--hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8
4287
# via mypy
88+
packaging==23.0 \
89+
--hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2 \
90+
--hash=sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97
91+
# via
92+
# -r requirements/pytest.pip
93+
# pytest
94+
pluggy==1.0.0 \
95+
--hash=sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159 \
96+
--hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3
97+
# via
98+
# -r requirements/pytest.pip
99+
# pytest
100+
pytest==7.2.0 \
101+
--hash=sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71 \
102+
--hash=sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59
103+
# via
104+
# -r requirements/pytest.pip
105+
# pytest-xdist
106+
pytest-xdist==3.1.0 \
107+
--hash=sha256:40fdb8f3544921c5dfcd486ac080ce22870e71d82ced6d2e78fa97c2addd480c \
108+
--hash=sha256:70a76f191d8a1d2d6be69fc440cdf85f3e4c03c08b520fd5dc5d338d6cf07d89
109+
# via -r requirements/pytest.pip
110+
sortedcontainers==2.4.0 \
111+
--hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \
112+
--hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0
113+
# via
114+
# -r requirements/pytest.pip
115+
# hypothesis
43116
tomli==2.0.1 \
44117
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
45118
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
46-
# via mypy
119+
# via
120+
# -r requirements/pytest.pip
121+
# mypy
122+
# pytest
47123
typed-ast==1.5.4 \
48124
--hash=sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2 \
49125
--hash=sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1 \
@@ -73,4 +149,13 @@ typed-ast==1.5.4 \
73149
typing-extensions==4.4.0 \
74150
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
75151
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
76-
# via mypy
152+
# via
153+
# -r requirements/pytest.pip
154+
# importlib-metadata
155+
# mypy
156+
zipp==3.11.0 \
157+
--hash=sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa \
158+
--hash=sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766
159+
# via
160+
# -r requirements/pytest.pip
161+
# importlib-metadata

Diff for: tests/mixins.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import os.path
1515
import sys
1616

17-
from typing import Any, Callable, Iterable, Iterator, Optional, Tuple
17+
from typing import Any, Callable, Iterable, Iterator, Optional, Tuple, cast
1818

1919
import pytest
2020

@@ -138,12 +138,12 @@ def _capcapsys(self, capsys: pytest.CaptureFixture[str]) -> None:
138138

139139
def stdouterr(self) -> Tuple[str, str]:
140140
"""Returns (out, err), two strings for stdout and stderr."""
141-
return self.capsys.readouterr() # type: ignore[no-any-return]
141+
return cast(Tuple[str, str], self.capsys.readouterr())
142142

143143
def stdout(self) -> str:
144144
"""Returns a string, the captured stdout."""
145-
return self.capsys.readouterr().out # type: ignore[no-any-return]
145+
return self.capsys.readouterr().out
146146

147147
def stderr(self) -> str:
148148
"""Returns a string, the captured stderr."""
149-
return self.capsys.readouterr().err # type: ignore[no-any-return]
149+
return self.capsys.readouterr().err

Diff for: tests/test_oddball.py

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def test_dropping_none(self) -> None: # pragma: not covered
209209
pytest.skip("This is too expensive for now (30s)")
210210
# Start and stop coverage thousands of times to flush out bad
211211
# reference counting, maybe.
212+
_ = "this is just here to put a type comment on" # type: ignore[unreachable]
212213
self.make_file("the_code.py", """\
213214
import random
214215
def f():

Diff for: tests/test_venv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
4848
Returns the directory containing the "venv" virtualenv.
4949
"""
5050

51-
venv_world = cast(Path, tmp_path_factory.mktemp("venv_world"))
51+
venv_world = tmp_path_factory.mktemp("venv_world")
5252
with change_dir(venv_world):
5353
# Create a virtualenv.
5454
run_command("python -m venv venv")

0 commit comments

Comments
 (0)