diff --git a/mypyc/test-data/fixtures/ir.py b/mypyc/test-data/fixtures/ir.py index c041c661741c..ecca7346f036 100644 --- a/mypyc/test-data/fixtures/ir.py +++ b/mypyc/test-data/fixtures/ir.py @@ -47,6 +47,7 @@ def __ne__(self, x: object) -> bool: pass class type: def __init__(self, o: object) -> None: ... def __or__(self, o: object) -> Any: ... + def __new__(cls, *args: object) -> Any: ... __name__ : str __annotations__: Dict[str, Any] diff --git a/mypyc/test-data/run-classes.test b/mypyc/test-data/run-classes.test index 6f1217bd36e6..1f2466179e6d 100644 --- a/mypyc/test-data/run-classes.test +++ b/mypyc/test-data/run-classes.test @@ -811,7 +811,7 @@ def test_classmethod_with_allow_interpreted() -> None: [file interp.py] def make_interpreted_subclass(base): - class Sub(base): + class Sub(base): # type: ignore[misc, valid-type] @classmethod def g(cls, x: int) -> int: return x + 3 @@ -2473,7 +2473,7 @@ def test_interpreted_subclass() -> None: from testutil import assertRaises def define_interpreted_subclass(b): - class DerivedInterpreted1(b): + class DerivedInterpreted1(b): # type: ignore[misc, valid-type] def __init__(self): # Don't call base class __init__ pass @@ -2486,10 +2486,10 @@ def define_interpreted_subclass(b): with assertRaises(AttributeError): del d1.x - class DerivedInterpreted1(b): + class DerivedInterpreted2(b): # type: ignore[misc, valid-type] def __init__(self): super().__init__('y') - d2 = DerivedInterpreted1() + d2 = DerivedInterpreted2() assert d2.x == 5 assert d2.s == 'y' with assertRaises(AttributeError): diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py index 172a1016dd91..b55847785e25 100644 --- a/mypyc/test/test_run.py +++ b/mypyc/test/test_run.py @@ -204,6 +204,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) -> options.preserve_asts = True options.allow_empty_bodies = True options.incremental = self.separate + options.check_untyped_defs = True # Avoid checking modules/packages named 'unchecked', to provide a way # to test interacting with code we don't have types for.