File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1096,7 +1096,7 @@ def fields_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
1096
1096
)
1097
1097
1098
1098
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' ,
1100
1100
ctx .context ,
1101
1101
)
1102
1102
return ctx .default_signature
Original file line number Diff line number Diff line change @@ -1562,7 +1562,7 @@ reveal_type(f(A)[0]) # N: Revealed type is "attr.Attribute[builtins.int]"
1562
1562
reveal_type(f(A).b) # N: Revealed type is "attr.Attribute[builtins.int]"
1563
1563
f(A).x # E: "____main___A_AttrsAttributes__" has no attribute "x"
1564
1564
1565
- [builtins fixtures/attr .pyi]
1565
+ [builtins fixtures/plugin_attrs .pyi]
1566
1566
1567
1567
[case testAttrsGenericFields]
1568
1568
from typing import TypeVar
@@ -1584,7 +1584,7 @@ def f(t: TA) -> None:
1584
1584
fields(t).x # E: "____main___A_AttrsAttributes__" has no attribute "x"
1585
1585
1586
1586
1587
- [builtins fixtures/attr .pyi]
1587
+ [builtins fixtures/plugin_attrs .pyi]
1588
1588
1589
1589
[case testNonattrsFields]
1590
1590
from typing import Any, cast
@@ -1598,7 +1598,7 @@ fields(A) # E: Argument 1 to "fields" has incompatible type "Type[A]"; expected
1598
1598
fields(None) # E: Argument 1 to "fields" has incompatible type "None"; expected an attrs class
1599
1599
fields(cast(Any, 42))
1600
1600
1601
- [builtins fixtures/attr .pyi]
1601
+ [builtins fixtures/plugin_attrs .pyi]
1602
1602
1603
1603
[case testAttrsInitMethodAlwaysGenerates]
1604
1604
from typing import Tuple
You can’t perform that action at this time.
0 commit comments