diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e29d32c..3db08ec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,7 +69,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - version: ["3.9.x", "3.10.x", "3.11.x", "3.12.x"] + version: ["3.10.x", "3.11.x", "3.12.x", "3.13.x", "3.14.x"] steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 27a9ab0..2de8ce5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3", ] diff --git a/tests/test_util.py b/tests/test_util.py index 2c93d2c..7d49da8 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,3 +1,5 @@ +import sys + import pytest from fastapi_problem import util @@ -14,5 +16,22 @@ (422, "Unprocessable Entity", "http-unprocessable-entity"), ], ) +@pytest.mark.skipif(sys.version_info >= (3, 13), reason="python version too new") +def test_convert_status_code_legacy(status_code, title, code): + assert util.convert_status_code(status_code) == (title, code) + + +@pytest.mark.parametrize( + ("status_code", "title", "code"), + [ + (500, "Internal Server Error", "http-internal-server-error"), + (400, "Bad Request", "http-bad-request"), + (401, "Unauthorized", "http-unauthorized"), + (404, "Not Found", "http-not-found"), + (409, "Conflict", "http-conflict"), + (422, "Unprocessable Content", "http-unprocessable-content"), + ], +) +@pytest.mark.skipif(sys.version_info < (3, 13), reason="python version too old") def test_convert_status_code(status_code, title, code): assert util.convert_status_code(status_code) == (title, code)