Skip to content

Commit 3536cd3

Browse files
authored
Add reason to ignore mypy assert-type in tests (#377)
1 parent b7c58bd commit 3536cd3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,14 @@ disallow_untyped_defs = false
151151
disable_error_code = [
152152
# Not all imports in these stubs are gonna be typed
153153
"import-untyped",
154+
# mypy's overload implementation differs from pyright
155+
# `assert-type` issues is tests mostly comme from checking overloads
156+
# Since this project is specific to Pylance, just ignore them
157+
"assert-type",
154158
# TODO
155159
"valid-type", # 967 errors in 115 files
156160
"override", # 790 errors in 220 files
157161
"assignment", # 773 errors in 172 files
158162
"misc", # 692 errors in 132 files
159163
"attr-defined", # 202 errors in 75 files
160-
"assert-type", # 6 errors in 1 file
161164
]

stubs/sklearn/preprocessing/_data.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def normalize(
221221
*,
222222
axis: int = 1,
223223
copy: bool = True,
224-
return_norm: Literal[False] = ...,
224+
return_norm: Literal[False] = False,
225225
) -> csr_matrix: ...
226226
@overload
227227
def normalize(
@@ -239,7 +239,7 @@ def normalize(
239239
*,
240240
axis: int = 1,
241241
copy: bool = True,
242-
return_norm: Literal[False] = ...,
242+
return_norm: Literal[False] = False,
243243
) -> ndarray: ...
244244
def normalize(
245245
X: MatrixLike | ArrayLike,

0 commit comments

Comments
 (0)