Files
pydantic/tests/mypy/fail2.py
T
dmontagu 6c0f4f31d1 Test mypy integration with pytest (#735)
* Test mypy integration with pytest

* Fix for without deps

* Fix filenames issue

* Remove python run in external-mypy

* Update changes

* Remove external-mypy
2019-08-17 12:59:11 +01:00

21 lines
379 B
Python

"""
Test mypy failure with invalid types.
"""
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, NoneStr
class Model(BaseModel):
age: int
first_name = 'John'
last_name: NoneStr = None
signup_ts: Optional[datetime] = None
list_of_ints: List[int]
m = Model(age=42, list_of_ints=[1, '2', b'3'])
print(m.foobar)