fix test_is_stuck.py to not fail on macos (#3662)

This commit is contained in:
tobitege 2024-08-30 07:06:30 +02:00 committed by GitHub
parent 090c911a50
commit 1ef83a8554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,12 +75,12 @@ class TestStuckDetector:
def _impl_unterminated_string_error_events(
self, event_stream: EventStream, random_line: bool
):
for _ in range(4):
for i in range(4):
ipython_action = IPythonRunCellAction(code='print("hello')
event_stream.add_event(ipython_action, EventSource.AGENT)
line_number = str(random.randint(1, 10)) if random_line else '1'
line_number = i * 10 if random_line else '1'
ipython_observation = IPythonRunCellObservation(
content=f'print("hello\n ^\nSyntaxError: unterminated string literal (detected at line {line_number})'
content=f'print(" Cell In[1], line {line_number}\nhello\n ^\nSyntaxError: unterminated string literal (detected at line {line_number})'
+ jupyter_line_1
+ jupyter_line_2,
code='print("hello',