A project folder to run in, outside any `uv run`, with no key or model set.
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
| 62 | |
| 63 | @pytest.fixture |
| 64 | def project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: |
| 65 | """A project folder to run in, outside any `uv run`, with no key or model set.""" |
| 66 | folder = tmp_path / "demo" |
| 67 | folder.mkdir() |
| 68 | monkeypatch.chdir(folder) |
| 69 | monkeypatch.delenv("UV_RUN_RECURSION_DEPTH", raising=False) |
| 70 | monkeypatch.delenv("CREWAI_DMN", raising=False) |
| 71 | monkeypatch.setattr(sys, "path", list(sys.path)) |
| 72 | names = { |
| 73 | str(details["key_name"]).upper() |
| 74 | for entries in ENV_VARS.values() |
| 75 | for details in entries |
| 76 | if "key_name" in details |
| 77 | } |
| 78 | names |= { |
| 79 | "GOOGLE_API_KEY", |
| 80 | "GOOGLE_CLOUD_PROJECT", |
| 81 | "MODEL", |
| 82 | "MODEL_NAME", |
| 83 | "OPENAI_MODEL_NAME", |
| 84 | run_crew_module.RUN_COUNTED_ENV, |
| 85 | } |
| 86 | for name in names: |
| 87 | # Set first, so teardown restores what the machine had even after the |
| 88 | # command under test exports a key. |
| 89 | monkeypatch.setenv(name, "") |
| 90 | monkeypatch.delenv(name) |
| 91 | return folder |
| 92 | |
| 93 | |
| 94 | @pytest.fixture |
nothing calls this directly
no outgoing calls
no test coverage detected