(self, timeout: TimeoutTypes | UnsetType)
| 112 | return self._client |
| 113 | |
| 114 | def _get_timeout(self, timeout: TimeoutTypes | UnsetType) -> httpx.Timeout: |
| 115 | _timeout = None |
| 116 | if isinstance(timeout, Timeout): |
| 117 | avg_timeout = timeout.total and timeout.total / 4 |
| 118 | timeout_kwargs: dict[str, float | None] = exclude_unset( |
| 119 | { |
| 120 | "timeout": avg_timeout, |
| 121 | "connect": timeout.connect, |
| 122 | "read": timeout.read, |
| 123 | } |
| 124 | ) |
| 125 | if timeout_kwargs: |
| 126 | _timeout = httpx.Timeout(**timeout_kwargs) |
| 127 | elif timeout is not UNSET: |
| 128 | _timeout = httpx.Timeout(timeout) |
| 129 | |
| 130 | if _timeout is None: |
| 131 | return self._timeout |
| 132 | return _timeout |
| 133 | |
| 134 | @override |
| 135 | async def request(self, setup: Request) -> Response: |
no test coverage detected