diff options
author | David Euresti <david@pilot.com> | 2020-12-20 21:21:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 06:21:28 +0100 |
commit | 3d274d0bfab142bc45504533f2c2b5f5ce519fd7 (patch) | |
tree | a754b439a4956dd517313267cce337a4d31ad8f2 /tests/test_mypy.yml | |
parent | 1c81e3ef7ec506f7e5a826ab65a4916c0386ec02 (diff) | |
download | attrs-3d274d0bfab142bc45504533f2c2b5f5ce519fd7.tar.gz |
WIP: Add mypy tests (#737)
* Add basic mypy tests
* Only run mypy on 3.6+
* No pypy
* Fix things
* Oooh parametrized
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" |