Skip to content

Commit

Permalink
Ignore msgspec on 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Sep 28, 2024
1 parent 148e9cb commit 869f2d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ def converter_cls(request):
collect_ignore_glob.append("*_695.py")
if platform.python_implementation() == "PyPy":
collect_ignore_glob.append("*_cpython.py")
if sys.version_info >= (3, 13): # Remove when msgspec supports 3.13.
collect_ignore_glob.append("test_msgspec_cpython.py")
11 changes: 7 additions & 4 deletions tests/test_preconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from json import dumps as json_dumps
from json import loads as json_loads
from platform import python_implementation
from typing import Any, Dict, List, NamedTuple, NewType, Tuple, Union
from typing import Any, Dict, Final, List, NamedTuple, NewType, Tuple, Union

import pytest
from attrs import define
Expand Down Expand Up @@ -699,7 +699,10 @@ def test_cbor2_unions(union_and_val: tuple, detailed_validation: bool):
assert converter.structure(val, type) == val


@pytest.mark.skipif(python_implementation() == "PyPy", reason="no msgspec on PyPy")
NO_MSGSPEC: Final = python_implementation() == "PyPy" or sys.version_info[:2] >= (3, 13)


@pytest.mark.skipif(NO_MSGSPEC, reason="msgspec not available")
@given(everythings(allow_inf=False))
def test_msgspec_json_converter(everything: Everything):
from cattrs.preconf.msgspec import make_converter as msgspec_make_converter
Expand All @@ -709,7 +712,7 @@ def test_msgspec_json_converter(everything: Everything):
assert converter.loads(raw, Everything) == everything


@pytest.mark.skipif(python_implementation() == "PyPy", reason="no msgspec on PyPy")
@pytest.mark.skipif(NO_MSGSPEC, reason="msgspec not available")
@given(everythings(allow_inf=False))
def test_msgspec_json_unstruct_collection_overrides(everything: Everything):
"""Ensure collection overrides work."""
Expand All @@ -724,7 +727,7 @@ def test_msgspec_json_unstruct_collection_overrides(everything: Everything):
assert raw["a_frozenset"] == sorted(raw["a_frozenset"])


@pytest.mark.skipif(python_implementation() == "PyPy", reason="no msgspec on PyPy")
@pytest.mark.skipif(NO_MSGSPEC, reason="msgspec not available")
@given(
union_and_val=native_unions(
include_datetimes=False,
Expand Down

0 comments on commit 869f2d8

Please sign in to comment.