-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
25 lines (21 loc) · 1.06 KB
/
conftest.py
File metadata and controls
25 lines (21 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Pytest configuration: stub heavy dependencies and set required env vars before scout is imported."""
import os
import sys
from unittest.mock import MagicMock
# Required env vars consumed at import time
os.environ.setdefault("ANTHROPIC_API_KEY", "test-anthropic-key")
os.environ.setdefault("GITHUB_TOKEN", "test-github-token")
os.environ.setdefault("SCOUT_GITHUB_REPO_OWNER", "test-owner")
os.environ.setdefault("SCOUT_GITHUB_REPO_NAME", "test-repo")
os.environ.setdefault("ISSUE_NUMBER", "42")
# Stub out packages that make network calls or require real credentials
_opik_mock = MagicMock()
_opik_mock.configure = MagicMock()
_opik_mock.track = lambda *a, **kw: (lambda fn: fn) # pass-through decorator
sys.modules.setdefault("opik", _opik_mock)
sys.modules.setdefault("opik.opik_context", MagicMock())
_opik_anthropic_mock = MagicMock()
_opik_anthropic_mock.track_anthropic = lambda client, **kw: client
sys.modules.setdefault("opik.integrations.anthropic", _opik_anthropic_mock)
sys.modules.setdefault("anthropic", MagicMock())
sys.modules.setdefault("dotenv", MagicMock())