Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

docs: clarify use of .env and automatic loading in pytest (#2373)

Yong Lia53083e53b0d
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 37cdae10c..d9b4ae185 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -355,13 +355,17 @@ To quickly run only local isolated unit and integration tests:
pytest --fast-test-mode .
```
-If you're developing with VSCode, make sure to create a `.env` file in the repository root and include your OpenAI API key:
+If you're developing with VSCode, make sure to:
+
+Add your API keys to the existing `.env` file at the repository root, for example:
```
OPENAI_API_KEY=sk-XXXXXXXX
OPENAI_API_BASE_URL=https://XXXXXXXX (Should you utilize an OpenAI proxy service, kindly specify this)
```
+The `conftest.py` file is already configured to automatically load the `.env` file, so you can run `pytest .` directly without extra setup.
+
## Documentation 📚
### Contribute to Documentation 📝
diff --git a/test/conftest.py b/test/conftest.py
index 94e545e50..8600c4630 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -16,6 +16,9 @@ from typing import List
import pytest
from _pytest.config import Config
from _pytest.nodes import Item
+from dotenv import load_dotenv
+
+load_dotenv()
def pytest_addoption(parser: pytest.Parser) -> None: