Skip to content

Commit a075b0b

Browse files
committed
Add tests to ensure this is working without the plugin
A bit of a hacky solution for now, maybe CI could be improved to add this kind of tests more easily. `var-annotated` is still an ignored error code as I wasn't able to change the assignment to an annotation for `ManyToManyField`s in my previous commit
1 parent 1f1f04d commit a075b0b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/typecheck/fields/test_base.yml

+22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
- case: test_model_fields_classes_present_as_primitives
2+
parametrized:
3+
- mypy_section: |
4+
[mypy]
5+
plugins =
6+
mypy_django_plugin.main
7+
- mypy_section: |
8+
[mypy]
9+
disable_error_code = var-annotated
10+
plugins =
11+
mypy_config: |
12+
{{ mypy_section }}
213
main: |
314
from myapp.models import User
415
user = User(small_int=1, name='user', slug='user', text='user')
@@ -75,6 +86,17 @@
7586
my_pk = models.IntegerField(primary_key=True)
7687
7788
- case: blank_and_null_char_field_allows_none
89+
parametrized:
90+
- mypy_section: |
91+
[mypy]
92+
plugins =
93+
mypy_django_plugin.main
94+
- mypy_section: |
95+
[mypy]
96+
disable_error_code = var-annotated
97+
plugins =
98+
mypy_config: |
99+
{{ mypy_section }}
78100
main: |
79101
from myapp.models import MyModel
80102
MyModel(nulltext="")

0 commit comments

Comments
 (0)