(request: FixtureRequest)
| 58 | |
| 59 | @pytest.fixture(scope="session") |
| 60 | async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncOpencode]: |
| 61 | param = getattr(request, "param", True) |
| 62 | |
| 63 | # defaults |
| 64 | strict = True |
| 65 | http_client: None | httpx.AsyncClient = None |
| 66 | |
| 67 | if isinstance(param, bool): |
| 68 | strict = param |
| 69 | elif is_dict(param): |
| 70 | strict = param.get("strict", True) |
| 71 | assert isinstance(strict, bool) |
| 72 | |
| 73 | http_client_type = param.get("http_client", "httpx") |
| 74 | if http_client_type == "aiohttp": |
| 75 | http_client = DefaultAioHttpClient() |
| 76 | else: |
| 77 | raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") |
| 78 | |
| 79 | async with AsyncOpencode(base_url=base_url, _strict_response_validation=strict, http_client=http_client) as client: |
| 80 | yield client |
nothing calls this directly
no test coverage detected