diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 721735d..eba8270 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12.0-rc.2"] include: - os: windows-2019 python_version: "3.6" diff --git a/requirements.txt b/requirements.txt index 33a1960..1669e18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ catalogue>=2.0.3,<2.1.0 # Development requirements cython>=0.29.1,<0.30.0 pytest>=4.6.5 -pytest-timeout>=1.3.3,<2.0.0 +pytest-timeout>=1.3.3 mock>=2.0.0,<3.0.0 numpy>=1.15.0 psutil diff --git a/srsly/tests/cloudpickle/cloudpickle_test.py b/srsly/tests/cloudpickle/cloudpickle_test.py index b293c53..e4dba00 100644 --- a/srsly/tests/cloudpickle/cloudpickle_test.py +++ b/srsly/tests/cloudpickle/cloudpickle_test.py @@ -740,13 +740,13 @@ def test_module_importability(self): pytest.importorskip("_cloudpickle_testpkg") from srsly.cloudpickle.compat import pickle import os.path - import distutils - import distutils.ccompiler + import collections + import collections.abc assert _should_pickle_by_reference(pickle) assert _should_pickle_by_reference(os.path) # fake (aliased) module - assert _should_pickle_by_reference(distutils) # package - assert _should_pickle_by_reference(distutils.ccompiler) # module in package + assert _should_pickle_by_reference(collections) # package + assert _should_pickle_by_reference(collections.abc) # module in package dynamic_module = types.ModuleType('dynamic_module') assert not _should_pickle_by_reference(dynamic_module) @@ -874,8 +874,8 @@ def test_builtin_classicmethod(self): or platform.python_implementation() == "PyPy" or (sys.version_info[:2] == (3, 10) and sys.version_info >= (3, 10, 8)) # Skipping tests on 3.11 due to https://github.com/cloudpipe/cloudpickle/pull/486. - or sys.version_info[:2] == (3, 11), - reason="Fails on aarch64 + python 3.10+ in cibuildwheel, currently unable to replicate failure elsewhere; fails sometimes for pypy on conda-forge; fails for python 3.10.8+ and 3.11") + or sys.version_info[:2] >= (3, 11), + reason="Fails on aarch64 + python 3.10+ in cibuildwheel, currently unable to replicate failure elsewhere; fails sometimes for pypy on conda-forge; fails for python 3.10.8+ and 3.11+") def test_builtin_classmethod(self): obj = 1.5 # float object @@ -1999,6 +1999,7 @@ def test_unhashable_function(self): self.assertEqual(depickled_method('a'), 1) self.assertEqual(depickled_method('b'), None) + @pytest.mark.skipif(sys.version_info >= (3, 12), reason="Deprecation warning in python 3.12 about future deprecation in python 3.14") def test_itertools_count(self): counter = itertools.count(1, step=2) diff --git a/srsly/tests/ruamel_yaml/test_comments.py b/srsly/tests/ruamel_yaml/test_comments.py index 67a856c..b65198d 100755 --- a/srsly/tests/ruamel_yaml/test_comments.py +++ b/srsly/tests/ruamel_yaml/test_comments.py @@ -583,7 +583,10 @@ def test_issue_60(self): ) assert data["x"]["a"] == 1 assert data["y"]["a"] == 1 - assert str(data["y"]) == """ordereddict([('a', 1)])""" + if sys.version_info >= (3, 12): + assert str(data["y"]) == """ordereddict({'a': 1})""" + else: + assert str(data["y"]) == """ordereddict([('a', 1)])""" def test_issue_60_1(self): data = round_trip_load( @@ -597,7 +600,10 @@ def test_issue_60_1(self): ) assert data["x"]["a"] == 1 assert data["y"]["a"] == 1 - assert str(data["y"]) == """ordereddict([('b', 2), ('a', 1)])""" + if sys.version_info >= (3, 12): + assert str(data["y"]) == """ordereddict({'b': 2, 'a': 1})""" + else: + assert str(data["y"]) == """ordereddict([('b', 2), ('a', 1)])""" class TestEmptyLines: diff --git a/srsly/tests/ruamel_yaml/test_issues.py b/srsly/tests/ruamel_yaml/test_issues.py index 57ee67f..11dfbb7 100755 --- a/srsly/tests/ruamel_yaml/test_issues.py +++ b/srsly/tests/ruamel_yaml/test_issues.py @@ -4,6 +4,7 @@ import pytest # NOQA +import sys from .roundtrip import ( @@ -34,9 +35,14 @@ def test_issue_61(self): ) data = srsly.ruamel_yaml.round_trip_load(s) assert str(data["comb"]) == str(data["def"]) - assert ( - str(data["comb"]) == "ordereddict([('key', 'value'), ('key1', 'value1')])" - ) + if sys.version_info >= (3, 12): + assert ( + str(data["comb"]) == "ordereddict({'key': 'value', 'key1': 'value1'})" + ) + else: + assert ( + str(data["comb"]) == "ordereddict([('key', 'value'), ('key1', 'value1')])" + ) def test_issue_82(self, tmpdir): program_src = r'''