diff --git a/tests/mypy_test.py b/tests/mypy_test.py index a495d65e49e6..29e9a31cc62c 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -132,6 +132,10 @@ def main(): flags.append("--no-implicit-optional") flags.append("--disallow-any-generics") flags.append("--disallow-subclassing-any") + # Setting custom typeshed dir prevents mypy from falling back to its bundled typeshed in + # case of stub deletions + flags.append("--custom-typeshed-dir") + flags.append(os.path.dirname(os.path.dirname(__file__))) if args.warn_unused_ignores: flags.append("--warn-unused-ignores") if args.platform: