Skip to content

Commit

Permalink
no_type_check
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 23, 2024
1 parent 893cd54 commit 0bd3c1e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mypy/test/teststubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", "")
Expand Down

0 comments on commit 0bd3c1e

Please sign in to comment.