Skip to content

Commit c3c1698

Browse files
author
Mateusz
committed
Fix thinking config test isolation issues
Add environment isolation fixture to test_thinking_config_translation.py to prevent THINKING_BUDGET environment variable pollution between tests. All tests now pass: 3,044 passed, 38 skipped, 0 failed.
1 parent cc86465 commit c3c1698

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/unit/test_thinking_config_translation.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010
from src.core.services.translation_service import TranslationService
1111

1212

13+
@pytest.fixture(autouse=True)
14+
def isolate_test_completely():
15+
"""Ensure complete test isolation by clearing any global state."""
16+
import os
17+
18+
# Store original environment
19+
original_env = dict(os.environ)
20+
21+
yield
22+
23+
# Restore original environment completely
24+
os.environ.clear()
25+
os.environ.update(original_env)
26+
27+
1328
class TestThinkingConfigTranslation:
1429
"""Test reasoning_effort -> thinkingBudget translation."""
1530

0 commit comments

Comments
 (0)