diff --git a/mypy/options.py b/mypy/options.py index b3dc9639a41d..5aced56c940f 100644 --- a/mypy/options.py +++ b/mypy/options.py @@ -74,6 +74,7 @@ class BuildType: "disable_memoryview_promotion", "strict_bytes", "fixed_format_cache", + "untyped_calls_exclude", } ) - {"debug_cache"} diff --git a/test-data/unit/check-incremental.test b/test-data/unit/check-incremental.test index defe7402730f..76532e6eba4a 100644 --- a/test-data/unit/check-incremental.test +++ b/test-data/unit/check-incremental.test @@ -6865,6 +6865,24 @@ if int(): [out2] main:6: error: Incompatible types in assignment (expression has type "str", variable has type "int") +[case testUntypedCallsExcludeAffectsCache] +# flags: --disallow-untyped-calls --untyped-calls-exclude=mod.Super +# flags2: --disallow-untyped-calls --untyped-calls-exclude=mod +# flags3: --disallow-untyped-calls --untyped-calls-exclude=mod.Super +import mod +[file mod.py] +class Super: + def draw(self): + ... +class Class(Super): + ... +Class().draw() +[out] +tmp/mod.py:6: error: Call to untyped function "draw" in typed context +[out2] +[out3] +tmp/mod.py:6: error: Call to untyped function "draw" in typed context + [case testMethodMakeBoundIncremental] from a import A a = A()