-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathconftest.py
More file actions
34 lines (27 loc) · 1.08 KB
/
conftest.py
File metadata and controls
34 lines (27 loc) · 1.08 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
26
27
28
29
30
31
32
33
34
"""
Global test configuration and fixtures for ContentProcessor tests.
"""
import sys
import os
import pytest
from unittest.mock import patch, MagicMock
# Add src directory to Python path for imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
pytest_plugins = ["pytest_mock"]
@pytest.fixture(autouse=True, scope="function")
def mock_azure_credentials_for_helpers(request):
"""
Mock Azure credentials for azure_helper classes only.
Skip this for credential utility tests that need to test the actual logic.
"""
# Skip mocking for credential utility tests
if "test_azure_credential_utils" in str(request.fspath):
yield
return
with patch("helpers.azure_credential_utils.get_azure_credential") as mock_get_cred, \
patch("helpers.azure_credential_utils.get_azure_credential_async") as mock_get_cred_async:
# Create mock credential objects
mock_credential = MagicMock()
mock_get_cred.return_value = mock_credential
mock_get_cred_async.return_value = mock_credential
yield mock_credential