Skip to content

Commit

Permalink
add version guard
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 22, 2024
1 parent 5b631cc commit 7e07a99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mypy/test/teststubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,9 @@ class TestClass(argparse.Action):
assert_equal(output, ["class C(argparse.Action): ..."])
assert_equal(gen.get_imports().splitlines(), ["import argparse"])

@unittest.skipIf(
sys.version < (3, 12), "Inline Generics not supported before Python3.12"
)
def test_inline_generic_class(self) -> None:
T = TypeVar("T")

Expand All @@ -943,6 +946,9 @@ class TestClass:
gen.generate_class_stub("C", TestClass, output)
assert_equal(output, ["class C[T]: ..."])

@unittest.skipIf(
sys.version < (3, 12), "Inline Generics not supported before Python3.12"
)
def test_inline_generic_function(self) -> None:
T = TypeVar("T", bound=int)

Expand Down

0 comments on commit 7e07a99

Please sign in to comment.