sphinx-contrib / openapi

OpenAPI (fka Swagger) spec renderer for Sphinx.
https://sphinxcontrib-openapi.readthedocs.io
BSD 2-Clause "Simplified" License
111 stars 81 forks source link

Test failures with Python 3.13 #161

Closed juliangilbey closed 1 week ago

juliangilbey commented 1 week ago

Hi!

Python 3.13 has changed the message associated with HTTP code 422 from 'Unprocessable Entity' to 'Unprocessable Content', which breaks three tests:

FAILED tests/renderers/httpdomain/test_render_response.py::test_render_response_content_custom[422]
FAILED tests/renderers/httpdomain/test_render_response_example.py::test_render_response_status_code[422]
FAILED tests/renderers/httpdomain/test_render_response_example.py::test_render_response_status_code_int[422]

So these tests require some sort of conditional to change the expected output depending on the Python version. I don't know how to do this "nicely", though.

juliangilbey commented 1 week ago

Actually, I spoke too soon; it seems quite straightforward, and I have made a PR to fix this.