The endpoint and proxy settings the machine's environment held as the CLI started, VALUES alone, and none since: a test's own machine has its own.
(monkeypatch: pytest.MonkeyPatch, **values: str)
| 136 | |
| 137 | |
| 138 | def machine_endpoints(monkeypatch: pytest.MonkeyPatch, **values: str) -> None: |
| 139 | """The endpoint and proxy settings the machine's environment held as the CLI |
| 140 | started, VALUES alone, and none since: a test's own machine has its own.""" |
| 141 | monkeypatch.setattr(api_keys, "_MACHINE_ENDPOINTS", api_keys._endpoint_settings(values)) |
| 142 | for name in ("OPENAI_BASE_URL", *api_keys._endpoint_settings(os.environ), *values): |
| 143 | # Set first, so teardown restores what the machine had after a test |
| 144 | # loads a project's `.env` into the environment. |
| 145 | monkeypatch.setenv(name, "") |
| 146 | monkeypatch.delenv(name) |
| 147 | for name, value in values.items(): |
| 148 | monkeypatch.setenv(name, value) |
| 149 | |
| 150 | |
| 151 | # At a terminal |
no outgoing calls
no test coverage detected