Skip to content

Commit e758e08

Browse files
committed
add test timeout
1 parent 1046a61 commit e758e08

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

mypyc/test/test_run.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import subprocess
1212
import sys
1313
import time
14-
from time import sleep
1514
from typing import Any, Iterator, cast
1615

1716
from mypy import build
@@ -313,16 +312,8 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
313312
stderr=subprocess.STDOUT,
314313
env=env,
315314
)
316-
try:
317-
proc.wait(timeout=0)
318-
except subprocess.TimeoutExpired:
319-
print("Timed out")
320-
while True:
321-
c = proc.stdout.read(1)
322-
if c == b"":
323-
break
324-
print(c.decode(), end='')
325-
raise
315+
if sys.version_info() >= (3, 12):
316+
proc.wait(timeout=30)
326317
output = proc.communicate()[0].decode("utf8")
327318
outlines = output.splitlines()
328319

0 commit comments

Comments
 (0)