Skip to content

Commit fd35af3

Browse files
committed
make pyright tests more strict
1 parent 2e010ec commit fd35af3

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

whole-repo-tests/test_pyright.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ def test_bar(x: str):
118118
)
119119
)
120120
_write_config(tmp_path, {"typeCheckingMode": "strict"})
121-
assert any(
122-
e["message"].startswith('No overloads for "given" match the provided arguments')
123-
for e in _get_pyright_errors(file)
121+
assert (
122+
sum(
123+
e["message"].startswith(
124+
'No overloads for "given" match the provided arguments'
125+
)
126+
for e in _get_pyright_errors(file)
127+
)
128+
== 1
124129
)
125130

126131

@@ -155,11 +160,14 @@ def test_pyright_tuples_pos_args_only(tmp_path: Path):
155160
)
156161
)
157162
_write_config(tmp_path, {"typeCheckingMode": "strict"})
158-
assert any(
159-
e["message"].startswith(
160-
'No overloads for "tuples" match the provided arguments'
163+
assert (
164+
sum(
165+
e["message"].startswith(
166+
'No overloads for "tuples" match the provided arguments'
167+
)
168+
for e in _get_pyright_errors(file)
161169
)
162-
for e in _get_pyright_errors(file)
170+
== 2
163171
)
164172

165173

@@ -176,11 +184,14 @@ def test_pyright_one_of_pos_args_only(tmp_path: Path):
176184
)
177185
)
178186
_write_config(tmp_path, {"typeCheckingMode": "strict"})
179-
assert any(
180-
e["message"].startswith(
181-
'No overloads for "one_of" match the provided arguments'
187+
assert (
188+
sum(
189+
e["message"].startswith(
190+
'No overloads for "one_of" match the provided arguments'
191+
)
192+
for e in _get_pyright_errors(file)
182193
)
183-
for e in _get_pyright_errors(file)
194+
== 2
184195
)
185196

186197

0 commit comments

Comments
 (0)