mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
@@ -1,7 +1,7 @@
|
||||
from typing import Any, ClassVar, Dict, Generic, Tuple, Type, TypeVar, Union, get_type_hints
|
||||
|
||||
from pydantic import BaseModel, create_model
|
||||
from pydantic.class_validators import gather_validators
|
||||
from pydantic.main import BaseModel, create_model
|
||||
|
||||
_generic_types_cache: Dict[Tuple[Type[Any], Union[Any, Tuple[Any, ...]]], Type[BaseModel]] = {}
|
||||
GenericModelT = TypeVar('GenericModelT', bound='GenericModel')
|
||||
|
||||
+1
-1
@@ -238,7 +238,7 @@ class PyObject:
|
||||
|
||||
|
||||
class ConstrainedNumberMeta(type):
|
||||
def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt':
|
||||
def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': # type: ignore
|
||||
new_cls = cast('ConstrainedInt', type.__new__(cls, name, bases, dct))
|
||||
|
||||
if new_cls.gt is not None and new_cls.ge is not None:
|
||||
|
||||
@@ -5,7 +5,7 @@ warn_redundant_casts = True
|
||||
warn_unused_ignores = True
|
||||
disallow_any_generics = True
|
||||
check_untyped_defs = True
|
||||
no_implicit_reexport = True
|
||||
;no_implicit_reexport = True
|
||||
|
||||
# for strict mypy: (this is the tricky one :-))
|
||||
disallow_untyped_defs = True
|
||||
|
||||
@@ -5,7 +5,7 @@ Cython==0.29.13;sys_platform!='win32'
|
||||
flake8==3.7.8
|
||||
flake8-quotes==2.1.0
|
||||
isort==4.3.21
|
||||
mypy==0.720
|
||||
mypy==0.730
|
||||
pycodestyle==2.5.0
|
||||
pyflakes==2.1.1
|
||||
pytest==5.1.3
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ expected_successes = [('tests/mypy/success.py', ('', '', 0))]
|
||||
@pytest.mark.skipif(not typing_extensions, reason='typing_extensions not installed')
|
||||
@pytest.mark.parametrize('filename,expected_result', expected_successes + expected_fails)
|
||||
def test_mypy_results(filename, expected_result):
|
||||
actual_result = api.run([filename, '--config-file', 'tests/mypy/mypy-default.ini'])
|
||||
actual_result = api.run([filename, '--config-file', 'tests/mypy/mypy-default.ini', '--no-error-summary'])
|
||||
|
||||
expected_out, expected_err, expected_returncode = expected_result
|
||||
actual_out, actual_err, actual_returncode = actual_result
|
||||
|
||||
Reference in New Issue
Block a user