Skip to content

Commit d366b1e

Browse files
committed
Restore critical test infrastructure
The test infrastructure for handling run_id and gateway API key was incorrectly removed in d933a1d. These regex replacements are essential for the documentation examples to pass, as they convert actual UUIDs to the '...' placeholder pattern used in docs.
1 parent 41791d5 commit d366b1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_examples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def print(self, *args: Any, **kwargs: Any) -> None:
179179
env.set('MOONSHOTAI_API_KEY', 'testing')
180180
env.set('DEEPSEEK_API_KEY', 'testing')
181181
env.set('OVHCLOUD_API_KEY', 'testing')
182+
env.set('PYDANTIC_AI_GATEWAY_API_KEY', 'testing')
182183

183184
prefix_settings = example.prefix_settings()
184185
opt_test = prefix_settings.get('test', '')
@@ -258,7 +259,9 @@ def print(self, *args: Any, **kwargs: Any) -> None:
258259
def print_callback(s: str) -> str:
259260
s = re.sub(r'datetime\.datetime\(.+?\)', 'datetime.datetime(...)', s, flags=re.DOTALL)
260261
s = re.sub(r'\d\.\d{4,}e-0\d', '0.0...', s)
261-
return re.sub(r'datetime.date\(', 'date(', s)
262+
s = re.sub(r'datetime.date\(', 'date(', s)
263+
s = re.sub(r"run_id='.+?'", "run_id='...'", s)
264+
return s
262265

263266

264267
def mock_render_duration(seconds: float, force_signed: bool) -> str:

0 commit comments

Comments
 (0)