diff --git a/hishel/_async/_client.py b/hishel/_async/_client.py index 74f4c87..565b079 100644 --- a/hishel/_async/_client.py +++ b/hishel/_async/_client.py @@ -90,8 +90,8 @@ def _init_transport(self, *args, **kwargs)-> AsyncCacheTransport: # type: ignor def _init_proxy_transport(self, *args, **kwargs) -> AsyncCacheTransport: # type: ignore - _transport = super()._init_proxy_transport(*args, **kwargs) - return AsyncCacheTransport( + _transport = super()._init_proxy_transport(*args, **kwargs) # pragma: no cover + return AsyncCacheTransport( # pragma: no cover transport=_transport, storage=self._storage, cache_controller=self._controller diff --git a/hishel/_async/_pool.py b/hishel/_async/_pool.py index eba4186..96a72e4 100644 --- a/hishel/_async/_pool.py +++ b/hishel/_async/_pool.py @@ -23,9 +23,9 @@ def __init__(self, cache_controller: tp.Optional[Controller] = None) -> None: self._pool = pool - if storage is not None: + if storage is not None: # pragma: no cover self._storage = storage - else: # pragma: no cover + else: self._storage = AsyncFileStorage(serializer=DictSerializer()) if cache_controller is not None: # pragma: no cover @@ -69,7 +69,7 @@ async def handle_async_request(self, request: Request) -> Response: if self._controller.is_cachable(request=request, response=response): await self._storage.store(key, response) - else: + else: # pragma: no cover logger.debug(f"The response to the `{url}` url is not cacheable.") return response diff --git a/hishel/_sync/_client.py b/hishel/_sync/_client.py index b1a6d07..4c1ae08 100644 --- a/hishel/_sync/_client.py +++ b/hishel/_sync/_client.py @@ -90,8 +90,8 @@ def _init_transport(self, *args, **kwargs)-> CacheTransport: # type: ignore def _init_proxy_transport(self, *args, **kwargs) -> CacheTransport: # type: ignore - _transport = super()._init_proxy_transport(*args, **kwargs) - return CacheTransport( + _transport = super()._init_proxy_transport(*args, **kwargs) # pragma: no cover + return CacheTransport( # pragma: no cover transport=_transport, storage=self._storage, cache_controller=self._controller diff --git a/hishel/_sync/_pool.py b/hishel/_sync/_pool.py index 0851b04..63eca5d 100644 --- a/hishel/_sync/_pool.py +++ b/hishel/_sync/_pool.py @@ -23,9 +23,9 @@ def __init__(self, cache_controller: tp.Optional[Controller] = None) -> None: self._pool = pool - if storage is not None: + if storage is not None: # pragma: no cover self._storage = storage - else: # pragma: no cover + else: self._storage = FileStorage(serializer=DictSerializer()) if cache_controller is not None: # pragma: no cover @@ -69,7 +69,7 @@ def handle_request(self, request: Request) -> Response: if self._controller.is_cachable(request=request, response=response): self._storage.store(key, response) - else: + else: # pragma: no cover logger.debug(f"The response to the `{url}` url is not cacheable.") return response diff --git a/hishel/_utils.py b/hishel/_utils.py index 579b5a6..445ba2b 100644 --- a/hishel/_utils.py +++ b/hishel/_utils.py @@ -11,10 +11,10 @@ def normalized_url(url: tp.Union[httpcore.URL, str, bytes]) -> str: - if isinstance(url, str): + if isinstance(url, str): # pragma: no cover return url - if isinstance(url, bytes): + if isinstance(url, bytes): # pragma: no cover return url.decode('ascii') if isinstance(url, httpcore.URL):