MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / project

Function project

lib/cli/tests/test_run_usage.py:109–122  ·  view source on GitHub ↗

An empty folder to run in, headless, outside any `uv run`.

(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)

Source from the content-addressed store, hash-verified

107
108@pytest.fixture
109def project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
110 """An empty folder to run in, headless, outside any `uv run`."""
111 folder = tmp_path / SECRET
112 folder.mkdir()
113 monkeypatch.chdir(folder)
114 monkeypatch.setenv("CREWAI_DMN", "true")
115 # `uv run pytest` sets this, which would run declarative flows in-process.
116 monkeypatch.delenv("UV_RUN_RECURSION_DEPTH", raising=False)
117 monkeypatch.delenv(run_crew_module.RUN_COUNTED_ENV, raising=False)
118 monkeypatch.setattr(sys, "path", list(sys.path))
119 # The key crewAI's default model needs, so a run counts no missing key
120 # unless the test takes it away.
121 monkeypatch.setenv("OPENAI_API_KEY", "sk-test")
122 return folder
123
124
125@pytest.fixture

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected