Skip to content

Commit 410dff9

Browse files
committed
Ignore msgspec on 3.13
1 parent 148e9cb commit 410dff9

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ def converter_cls(request):
3737
collect_ignore_glob.append("*_695.py")
3838
if platform.python_implementation() == "PyPy":
3939
collect_ignore_glob.append("*_cpython.py")
40+
if sys.version_info >= (3, 13): # Remove when msgspec supports 3.13.
41+
collect_ignore_glob.append("*test_msgspec_cpython.py")

tests/test_preconf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from json import dumps as json_dumps
55
from json import loads as json_loads
66
from platform import python_implementation
7-
from typing import Any, Dict, List, NamedTuple, NewType, Tuple, Union
7+
from typing import Any, Dict, Final, List, NamedTuple, NewType, Tuple, Union
88

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

701701

702-
@pytest.mark.skipif(python_implementation() == "PyPy", reason="no msgspec on PyPy")
702+
NO_MSGSPEC: Final = python_implementation() == "PyPy" or sys.version_info[:2] >= (3, 13)
703+
704+
705+
@pytest.mark.skipif(NO_MSGSPEC, reason="msgspec not available")
703706
@given(everythings(allow_inf=False))
704707
def test_msgspec_json_converter(everything: Everything):
705708
from cattrs.preconf.msgspec import make_converter as msgspec_make_converter
@@ -709,7 +712,7 @@ def test_msgspec_json_converter(everything: Everything):
709712
assert converter.loads(raw, Everything) == everything
710713

711714

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

726729

727-
@pytest.mark.skipif(python_implementation() == "PyPy", reason="no msgspec on PyPy")
730+
@pytest.mark.skipif(NO_MSGSPEC, reason="msgspec not available")
728731
@given(
729732
union_and_val=native_unions(
730733
include_datetimes=False,

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ setenv =
4444
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
4545
COVERAGE_CORE=sysmon
4646

47+
[testenv:py313]
48+
setenv =
49+
PDM_IGNORE_SAVED_PYTHON="1"
50+
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
51+
COVERAGE_CORE=sysmon
52+
commands_pre =
53+
pdm sync -G ujson,msgpack,pyyaml,tomlkit,cbor2,bson,orjson,test
54+
python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
55+
4756
[testenv:pypy3]
4857
setenv =
4958
FAST = 1

0 commit comments

Comments
 (0)