From 410a80e3186f53a167d253c43ea463441f424aaa Mon Sep 17 00:00:00 2001 From: Joseph Perez Date: Fri, 20 Oct 2023 10:37:13 +0200 Subject: [PATCH] test: add LiteralString test --- tests/unit/test_visitor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit/test_visitor.py b/tests/unit/test_visitor.py index 431bb4b7..e4583c83 100644 --- a/tests/unit/test_visitor.py +++ b/tests/unit/test_visitor.py @@ -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", @@ -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, []), (