From 64f1daa886030e05ee2dda85344c70ffcf599ba2 Mon Sep 17 00:00:00 2001 From: Joseph Perez Date: Fri, 20 Oct 2023 10:48:28 +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, []), (