diff options
Diffstat (limited to 'tests/test_mypy.yml')
-rw-r--r-- | tests/test_mypy.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_mypy.yml b/tests/test_mypy.yml new file mode 100644 index 0000000..18128e6 --- /dev/null +++ b/tests/test_mypy.yml @@ -0,0 +1,23 @@ +- case: attr_s_with_type_argument + parametrized: + - val: 'a = attr.ib(type=int)' + - val: 'a: int = attr.ib()' + main: | + import attr + @attr.s + class C: + {{ val }} + C() # E: Too few arguments for "C" + C(1) + C(a=1) + C(a="hi") # E: Argument "a" to "C" has incompatible type "str"; expected "int" +- case: attr_s_with_type_annotations + main : | + import attr + @attr.s + class C: + a: int = attr.ib() + C() # E: Too few arguments for "C" + C(1) + C(a=1) + C(a="hi") # E: Argument "a" to "C" has incompatible type "str"; expected "int" |