vitalik / django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
https://django-ninja.dev
MIT License
7.03k stars 421 forks source link

Fixed coverage on Python>=3.11 #1276

Closed c4ffein closed 1 week ago

c4ffein commented 1 month ago

make test-cov is not at 100% on Python>=3.11 when executed locally. Nothing is wrong with the pipeline as it is still using Python 3.9 but it is a minor incovenience during development.

It is due to the fact that the handling of typing.Any becomes unnecessary with this change in cpython: python/cpython#88690

This PR resolves this situation by adding a quick UT that is not so useful for Python<3.11 but covers that specific try - except block.

We may (or may not) also add support for Python>=3.11 in the coverage pipeline, in this PR or another one.

c4ffein commented 1 month ago

I guess the change to typing.Any is introduced between 3.10.0 and 3.11.0, but better just ask for a first review anyway