Skip to content

Commit c95478d

Browse files
committed
Update tests
1 parent 7126c05 commit c95478d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mypy/plugins/attrs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ def fields_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
10961096
)
10971097

10981098
ctx.api.fail(
1099-
f'Argument 1 to "fields" has incompatible type "{format_type_bare(proper_type)}"; expected an attrs class',
1099+
f'Argument 1 to "fields" has incompatible type "{format_type_bare(proper_type, ctx.api.options)}"; expected an attrs class',
11001100
ctx.context,
11011101
)
11021102
return ctx.default_signature

test-data/unit/check-plugin-attrs.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ reveal_type(f(A)[0]) # N: Revealed type is "attr.Attribute[builtins.int]"
15621562
reveal_type(f(A).b) # N: Revealed type is "attr.Attribute[builtins.int]"
15631563
f(A).x # E: "____main___A_AttrsAttributes__" has no attribute "x"
15641564

1565-
[builtins fixtures/attr.pyi]
1565+
[builtins fixtures/plugin_attrs.pyi]
15661566

15671567
[case testAttrsGenericFields]
15681568
from typing import TypeVar
@@ -1584,7 +1584,7 @@ def f(t: TA) -> None:
15841584
fields(t).x # E: "____main___A_AttrsAttributes__" has no attribute "x"
15851585

15861586

1587-
[builtins fixtures/attr.pyi]
1587+
[builtins fixtures/plugin_attrs.pyi]
15881588

15891589
[case testNonattrsFields]
15901590
from typing import Any, cast
@@ -1598,7 +1598,7 @@ fields(A) # E: Argument 1 to "fields" has incompatible type "Type[A]"; expected
15981598
fields(None) # E: Argument 1 to "fields" has incompatible type "None"; expected an attrs class
15991599
fields(cast(Any, 42))
16001600

1601-
[builtins fixtures/attr.pyi]
1601+
[builtins fixtures/plugin_attrs.pyi]
16021602

16031603
[case testAttrsInitMethodAlwaysGenerates]
16041604
from typing import Tuple

0 commit comments

Comments
 (0)