Closed alessio-locatelli closed 6 months ago
Attention: Patch coverage is 97.95918%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 97.75%. Comparing base (
3aa2e5e
) to head (5b54454
).
Files | Patch % | Lines |
---|---|---|
aiohttp_client_cache/response.py | 92.85% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
There were some tricky places where I had two choices: a major refactoring or a "best effort" attempt to fix the type annotations.
A simplified example to explain a challenge I had to solve in the "test/" folder:
I was thinking about how to get IDE autocompletion and fix Mypy/Pyright warnings and come up with as small refactorings as possible, but better ideas are welcome.
The workaround was to define that if we pass
type[SQLiteCache]
then we getSQLiteCache
, etc.Another tricky task was the fact that you return
-> CachedResponse | ClientResponse
but in the tests you always check attributes ofCachedResponse
(e.g.from_cache
). The simplest workaround was usingcast()
to tell IDE and a type checker that we work in the test with theCachedResponse
.CI for 3.11 and 3.12 failed with
:heavy_check_mark: Locally I successfully executed all tests for
3.8
and3.12
.