diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 738b06e..89d0d7c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 diff --git a/setup.cfg b/setup.cfg index 7af0922..902b4d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Intended Audience :: Developers Operating System :: OS Independent License :: OSI Approved :: MIT License diff --git a/tests/test_xml.py b/tests/test_xml.py index 5b7c482..f6973b5 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -1,3 +1,4 @@ +import re import sys from pathlib import Path @@ -104,9 +105,7 @@ def _file_to_xml(path: Path): @pytest.mark.skipif(sys.version_info < (3, 9), reason="AST different on Python 3.8") def test_xml_everything(): # Smoke test to check we didn't break anything. - assert ( - _file_to_xml(DIR / "everything.py") - == """ + EXPECTED = """ @@ -177,6 +176,7 @@ def test_xml_everything(): + @@ -196,6 +196,7 @@ def test_xml_everything(): + @@ -214,6 +215,7 @@ def test_xml_everything(): + @@ -232,6 +234,7 @@ def test_xml_everything(): + @@ -253,6 +256,7 @@ def test_xml_everything(): + @@ -282,6 +286,7 @@ def test_xml_everything(): + @@ -290,6 +295,7 @@ def test_xml_everything(): + @@ -388,6 +394,7 @@ def test_xml_everything(): + @@ -417,4 +424,10 @@ def test_xml_everything(): """.lstrip() - ) + + # Hacks for different Python versios, we may need to just have a dictionary + # of different outputs + if sys.version_info < (3, 12): + EXPECTED = re.subn(r" *\n", "", EXPECTED)[0] + + assert _file_to_xml(DIR / "everything.py") == EXPECTED diff --git a/tox.ini b/tox.ini index 34f6d5e..5caacaf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -# Remember to add to .github/workflows/build.yml if this is added to. -envlist = py38, py39, py310, py311, mypy +# Remember to add to .github/workflows/tests.yml if this is added to. +envlist = py38, py39, py310, py311, py312, mypy [testenv]