Skip to content

Commit e58e920

Browse files
try adding # mypy: no-warn-unused-ignores comment
1 parent bfb2807 commit e58e920

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

databind.core/src/databind/core/tests/schema_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
# In Python 3.6, we get a warning about an unused ignore later in the file, but not in other versions of Python.
3+
# Let's ignore that warning for the whole file, there doesn't seem to be a better way to have Mypy ignore the unused
4+
# ignore comment.
5+
6+
# mypy: no-warn-unused-ignores
7+
18
import dataclasses
29
import typing as t
310

@@ -312,7 +319,7 @@ class B2(t.Generic[U]):
312319
)
313320
assert convert_dataclass_to_schema(B2) == Schema(
314321
{
315-
"a": Field(TypeHint(A[U])), # type: ignore[valid-type,unused-ignore] # Type variable U is unbound # noqa: E501
322+
"a": Field(TypeHint(A[U])), # type: ignore[valid-type] # Type variable U is unbound # noqa: E501
316323
"b": Field(TypeHint(str)),
317324
},
318325
B2,

0 commit comments

Comments
 (0)