Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
19 changes: 19 additions & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import pytest

from fastapi_problem import util
Expand All @@ -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)
Loading