(ctx: E2ETestContext)
| 229 | |
| 230 | @pytest_asyncio.fixture(loop_scope="module") |
| 231 | async def handler_fixture(ctx: E2ETestContext): |
| 232 | upstream = await _start_fake_upstream() |
| 233 | counters = _Counters() |
| 234 | handler = _TestHandler(upstream, counters) |
| 235 | github_token = ( |
| 236 | "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 237 | ) |
| 238 | env = {**ctx.get_env(), "COPILOT_EXP_COPILOT_CLI_WEBSOCKET_RESPONSES": "true"} |
| 239 | client = CopilotClient( |
| 240 | connection=RuntimeConnection.for_stdio(path=ctx.cli_path), |
| 241 | working_directory=ctx.work_dir, |
| 242 | env=env, |
| 243 | github_token=github_token, |
| 244 | request_handler=handler, |
| 245 | ) |
| 246 | try: |
| 247 | yield _HandlerFixture(client=client, upstream=upstream, counters=counters) |
| 248 | finally: |
| 249 | try: |
| 250 | await client.stop() |
| 251 | except Exception: |
| 252 | # Best-effort teardown during fixture cleanup. |
| 253 | pass |
| 254 | await handler.aclose() |
| 255 | await upstream.close() |
| 256 | |
| 257 | |
| 258 | class TestCopilotRequestHandler: |
nothing calls this directly
no test coverage detected
searching dependent graphs…