File patch_fix_test_IANA_HTTP_status.patch of Package python-sphinxcontrib-openapi
diff --git a/tests/renderers/httpdomain/test_render_response.py b/tests/renderers/httpdomain/test_render_response.py
index 020743d..1e97a37 100644
--- a/tests/renderers/httpdomain/test_render_response.py
+++ b/tests/renderers/httpdomain/test_render_response.py
@@ -2,9 +2,11 @@
import textwrap
import pytest
+import sys
from sphinxcontrib.openapi import renderers
+_http_422_error_string = "Unprocessable Content" if sys.version_info >= (3,13) else "Unprocessable Entity"
def textify(generator):
return "\n".join(generator)
@@ -211,14 +213,13 @@ def test_render_response_content_non_2xx(testrenderer, oas_fragment, status_code
""".rstrip()
)
-
@pytest.mark.parametrize(
["status_code", "status"],
[
pytest.param("301", "Moved Permanently", id="301"),
pytest.param("307", "Temporary Redirect", id="307"),
pytest.param("401", "Unauthorized", id="401"),
- pytest.param("422", "Unprocessable Entity", id="422"),
+ pytest.param("422", _http_422_error_string, id="422"),
],
)
def test_render_response_content_custom(fakestate, oas_fragment, status_code, status):
diff --git a/tests/renderers/httpdomain/test_render_response_example.py b/tests/renderers/httpdomain/test_render_response_example.py
index 99791c5..318931a 100644
--- a/tests/renderers/httpdomain/test_render_response_example.py
+++ b/tests/renderers/httpdomain/test_render_response_example.py
@@ -4,9 +4,11 @@ import textwrap
import pytest
import responses
+import sys
from sphinxcontrib.openapi import renderers
+_http_422_error_string = "Unprocessable Content" if sys.version_info >= (3,13) else "Unprocessable Entity"
def textify(generator):
return "\n".join(generator)
@@ -499,7 +501,7 @@ def test_render_response_example_noop(testrenderer, oas_fragment):
[
pytest.param("201", "Created", id="201"),
pytest.param("307", "Temporary Redirect", id="307"),
- pytest.param("422", "Unprocessable Entity", id="422"),
+ pytest.param("422", _http_422_error_string, id="422"),
],
)
def test_render_response_status_code(
@@ -577,7 +579,7 @@ def test_render_response_status_code_range(
[
pytest.param("201", "Created", id="201"),
pytest.param("307", "Temporary Redirect", id="307"),
- pytest.param("422", "Unprocessable Entity", id="422"),
+ pytest.param("422", _http_422_error_string, id="422"),
],
)
def test_render_response_status_code_int(