|
1 | | -- case: simplest_case |
2 | | - main: | |
3 | | - a = 1 |
4 | | - b = 'hello' |
| 1 | +- case: simplest_case |
| 2 | + main: | |
| 3 | + a = 1 |
| 4 | + b = 'hello' |
5 | 5 |
|
6 | | - class MyClass: |
| 6 | + class MyClass: |
| 7 | + pass |
| 8 | +
|
| 9 | + reveal_type(a) # N: Revealed type is "builtins.int" |
| 10 | + reveal_type(b) # N: Revealed type is "builtins.str" |
| 11 | +
|
| 12 | +
|
| 13 | +- case: revealed_type_with_environment |
| 14 | + main: | |
| 15 | + a = 1 |
| 16 | + class MyClass: |
| 17 | + def __init__(self): |
7 | 18 | pass |
8 | 19 |
|
9 | | - reveal_type(a) # N: Revealed type is 'builtins.int' |
10 | | - reveal_type(b) # N: Revealed type is 'builtins.str' |
11 | | -
|
12 | | -- case: revealed_type_with_environment |
13 | | - main: | |
14 | | - a = 1 |
15 | | - class MyClass: |
16 | | - def __init__(self): |
17 | | - pass |
18 | | -
|
19 | | - b = 'hello' |
20 | | -
|
21 | | - reveal_type(a) # N: Revealed type is 'builtins.int' |
22 | | - reveal_type(b) # N: Revealed type is 'builtins.str' |
23 | | - env: |
24 | | - - DJANGO_SETTINGS_MODULE=mysettings |
25 | | - |
26 | | -- case: revealed_type_with_disabled_cache |
27 | | - main: | |
28 | | - a = 1 |
29 | | - reveal_type(a) # N: Revealed type is 'builtins.int' |
30 | | - disable_cache: true |
31 | | - |
32 | | -- case: external_output_lines |
33 | | - main: | |
34 | | - a = 1 |
35 | | - reveal_type(a) |
36 | | - out: | |
37 | | - main:2: note: Revealed type is 'builtins.int' |
38 | | -
|
39 | | -- case: create_files |
40 | | - main: | |
41 | | - a = 1 |
42 | | - reveal_type(a) # N: Revealed type is 'builtins.int' |
43 | | - files: |
44 | | - - path: myapp/__init__.py |
45 | | - - path: myapp/models.py |
46 | | - content: | |
47 | | - from django.db import models |
48 | | - class MyModel: |
49 | | - pass |
50 | | - - path: myapp/apps.py |
51 | | - |
52 | | -- case: error_case |
53 | | - main: | |
54 | | - a = 1 |
55 | | - a.lower() # E: "int" has no attribute "lower" |
56 | | -
|
57 | | -- case: custom_mypy_config_strict_optional_true_set |
58 | | - main: | |
59 | | - from typing import Optional |
60 | | - a: Optional[int] = None |
61 | | - a + 1 |
62 | | - mypy_config: | |
63 | | - strict_optional = False |
64 | | -
|
65 | | -- case: skip_incorrect_test_case |
66 | | - skip: yes |
67 | | - main: | |
68 | | - a = 1 |
69 | | - reveal_type(a) # N: boom! |
70 | | -
|
71 | | -- case: skip_if_true |
72 | | - skip: sys.version_info > (2, 0) |
73 | | - main: | |
74 | | - a = 1 |
75 | | - a.lower() # E: boom! |
76 | | -
|
77 | | -- case: skip_if_false |
78 | | - skip: sys.version_info > (20, 0) |
79 | | - main: | |
80 | | - a = 1 |
81 | | - a.lower() # E: "int" has no attribute "lower" |
| 20 | + b = 'hello' |
| 21 | +
|
| 22 | + reveal_type(a) # N: Revealed type is "builtins.int" |
| 23 | + reveal_type(b) # N: Revealed type is "builtins.str" |
| 24 | + env: |
| 25 | + - DJANGO_SETTINGS_MODULE=mysettings |
| 26 | + |
| 27 | + |
| 28 | +- case: revealed_type_with_disabled_cache |
| 29 | + main: | |
| 30 | + a = 1 |
| 31 | + reveal_type(a) # N: Revealed type is "builtins.int" |
| 32 | + disable_cache: true |
| 33 | + |
| 34 | + |
| 35 | +- case: external_output_lines |
| 36 | + main: | |
| 37 | + a = 1 |
| 38 | + reveal_type(a) |
| 39 | + out: | |
| 40 | + main:2: note: Revealed type is "builtins.int" |
| 41 | +
|
| 42 | +
|
| 43 | +- case: create_files |
| 44 | + main: | |
| 45 | + a = 1 |
| 46 | + reveal_type(a) # N: Revealed type is "builtins.int" |
| 47 | + files: |
| 48 | + - path: myapp/__init__.py |
| 49 | + - path: myapp/models.py |
| 50 | + content: | |
| 51 | + from django.db import models |
| 52 | + class MyModel: |
| 53 | + pass |
| 54 | + - path: myapp/apps.py |
| 55 | + |
| 56 | + |
| 57 | +- case: error_case |
| 58 | + main: | |
| 59 | + a = 1 |
| 60 | + a.lower() # E: "int" has no attribute "lower" |
| 61 | +
|
| 62 | +
|
| 63 | +- case: custom_mypy_config_strict_optional_true_set |
| 64 | + main: | |
| 65 | + from typing import Optional |
| 66 | + a: Optional[int] = None |
| 67 | + a + 1 |
| 68 | + mypy_config: | |
| 69 | + strict_optional = False |
| 70 | +
|
| 71 | +
|
| 72 | +- case: skip_incorrect_test_case |
| 73 | + skip: yes |
| 74 | + main: | |
| 75 | + a = 1 |
| 76 | + reveal_type(a) # N: boom! |
| 77 | +
|
| 78 | +
|
| 79 | +- case: skip_if_true |
| 80 | + skip: sys.version_info > (2, 0) |
| 81 | + main: | |
| 82 | + a = 1 |
| 83 | + a.lower() # E: boom! |
| 84 | +
|
| 85 | +
|
| 86 | +- case: skip_if_false |
| 87 | + skip: sys.version_info < (0, 0) |
| 88 | + main: | |
| 89 | + a = 1 |
| 90 | + a.lower() # E: "int" has no attribute "lower" |
0 commit comments