Skip to content

Commit

Permalink
test: add LiteralString test
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Oct 20, 2023
1 parent 1cb8449 commit 64f1daa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/test_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class MyInt(int):
if sys.version_info >= (3, 10):
py310 = [(int | str, Visitor.union, [(int, str)])]

py311: list = []
if sys.version_info >= (3, 10):
from typing import LiteralString

py311 = [(LiteralString, Visitor.primitive, [str])]


@pytest.mark.parametrize(
"cls, method, args",
Expand All @@ -99,6 +105,7 @@ class MyInt(int):
(Dict[str, int], Visitor.mapping, [dict, str, int]),
*pep_585,
*py310,
*py311,
(Annotated[int, 42, "42"], Visitor.annotated, [int, (42, "42")]),
(Any, Visitor.any, []),
(
Expand Down

0 comments on commit 64f1daa

Please sign in to comment.