summaryrefslogtreecommitdiff
path: root/tests/test_mypy.yml
blob: 18128e6293e35bc128829fa5d7bc405ebd5d4122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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"