(self, kind)
| 971 | reason="CPython 3.12 internal changes prevent testing for recursion issues this way", |
| 972 | ) |
| 973 | def test_sequence_cyclic_recursion(self, kind): |
| 974 | depth = 50 |
| 975 | if kind == "list": |
| 976 | typ = List[int] |
| 977 | for _ in range(depth): |
| 978 | typ = List[typ] |
| 979 | elif kind == "tuple": |
| 980 | typ = Tuple[int, ...] |
| 981 | for _ in range(depth): |
| 982 | typ = Tuple[typ, ...] |
| 983 | elif kind == "fixtuple": |
| 984 | typ = Tuple[int] |
| 985 | for _ in range(depth): |
| 986 | typ = Tuple[typ] |
| 987 | elif kind == "set": |
| 988 | typ = FrozenSet[int] |
| 989 | for _ in range(depth): |
| 990 | typ = FrozenSet[typ] |
| 991 | |
| 992 | class Cache(Struct): |
| 993 | value: typ |
| 994 | |
| 995 | msgspec.json.Decoder(Cache) |
| 996 | |
| 997 | arr = [] |
| 998 | arr.append(arr) |
| 999 | msg = {"value": arr} |
| 1000 | with pytest.raises(RecursionError): |
| 1001 | with max_call_depth(5): |
| 1002 | convert(msg, Cache) |
| 1003 | |
| 1004 | @pytest.mark.parametrize("out_type", [list, tuple, set, frozenset]) |
| 1005 | def test_sequence_constrs(self, out_type): |
nothing calls this directly
no test coverage detected