Skip to content

Commit f22cca1

Browse files
committed
Stabilize MAX_DIFF_LINES default env parsing test
1 parent 4671d49 commit f22cca1

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

claudecode/test_github_action_audit.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,16 @@ def test_diff_line_counting(self):
447447
def test_max_diff_lines_env_parsing(self):
448448
"""Test that MAX_DIFF_LINES environment variable is parsed correctly."""
449449
import os
450+
from unittest.mock import patch
450451

451-
# Test default value
452-
max_lines_str = os.environ.get('MAX_DIFF_LINES', '5000')
453-
try:
454-
max_lines = int(max_lines_str)
455-
except ValueError:
456-
max_lines = 5000
452+
# Test default value when env var is not set
453+
with patch.dict('os.environ', {}, clear=False):
454+
os.environ.pop('MAX_DIFF_LINES', None)
455+
max_lines_str = os.environ.get('MAX_DIFF_LINES', '5000')
456+
try:
457+
max_lines = int(max_lines_str)
458+
except ValueError:
459+
max_lines = 5000
457460

458461
assert max_lines == 5000 # Default when not set
459462

0 commit comments

Comments
 (0)