From c218ba07ee57e82ee0c188e68d774f081e268be6 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Sat, 19 Feb 2022 16:41:43 -0800 Subject: [PATCH] stubtest: ignore __main__ module --- mypy/stubtest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index dacd31dbcf84c..4577d7265d841 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -1287,7 +1287,8 @@ def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool = False) -> if args.check_typeshed: assert not args.modules, "Cannot pass both --check-typeshed and a list of modules" modules = get_typeshed_stdlib_modules(args.custom_typeshed_dir) - annoying_modules = {"antigravity", "this"} + # typeshed added a stub for __main__, but that causes stubtest to check itself + annoying_modules = {"antigravity", "this", "__main__"} modules = [m for m in modules if m not in annoying_modules] assert modules, "No modules to check"