From 0bd3c1ebaac61efda4bcecacca73325d8d52aaf4 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Tue, 23 Jul 2024 09:49:41 -0400 Subject: [PATCH] no_type_check --- mypy/test/teststubgen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mypy/test/teststubgen.py b/mypy/test/teststubgen.py index 1cd463f41160..b175f0b9fed6 100644 --- a/mypy/test/teststubgen.py +++ b/mypy/test/teststubgen.py @@ -8,7 +8,7 @@ import tempfile import unittest from types import ModuleType -from typing import Any, Tuple, TypeVar, cast +from typing import Any, Tuple, TypeVar, cast, no_type_check from typing_extensions import ParamSpec, TypeVarTuple import pytest @@ -944,12 +944,13 @@ class TestClass: gen.generate_class_stub("C", TestClass, output) assert_equal(output, ["class C[T]: ..."]) + # type: ignore used for older versions of python type checking inline generics. + @no_type_check @unittest.skipIf(sys.version_info < (3, 12), "Inline Generics not supported before Python3.12") def test_generic_class(self) -> None: exec("class Test[A]: ...") - # type: ignore used for older versions of python type checking - class TestClass[A]: ... # type: ignore + class TestClass[A]: ... output: list[str] = [] mod = ModuleType("module", "")