Commit 68ba0b0
committed
🐛 fix: add autouse fixture for API keys in unit tests
Add mock_openai_key fixture with autouse=True to automatically set
fake API keys for all unit tests, preventing OpenAI API key errors
when running tests in CI or local environments without credentials.
This fixes the CI failure where 7 tests were failing with:
"The api_key client option must be set either by passing api_key to
the client or by setting the OPENAI_API_KEY environment variable"1 parent 5117a52 commit 68ba0b0
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
0 commit comments