@@ -208,11 +208,6 @@ def call(*popenargs,
208
208
poll_procs = poll_procs or []
209
209
if not suppress_output_info :
210
210
print (f"Start subprocess with call({ popenargs } , { kwargs } )" )
211
- timeout = get_pytest_timeout (timeout )
212
- if timeout is None :
213
- actual_timeout = None
214
- else :
215
- actual_timeout = max (30 , int (timeout * 0.9 ))
216
211
with popen (* popenargs ,
217
212
start_new_session = start_new_session ,
218
213
suppress_output_info = True ,
@@ -223,7 +218,7 @@ def call(*popenargs,
223
218
return p .wait (timeout = spin_time )
224
219
except subprocess .TimeoutExpired :
225
220
elapsed_time += spin_time
226
- if actual_timeout is not None and elapsed_time >= actual_timeout :
221
+ if timeout is not None and elapsed_time >= timeout :
227
222
raise
228
223
for p_poll in poll_procs :
229
224
if p_poll .poll () is None :
@@ -327,28 +322,3 @@ def check_call_negative_test(*popenargs, **kwargs):
327
322
f"Subprocess expected to fail with check_call_negative_test({ popenargs } , { kwargs } ), but passed."
328
323
)
329
324
raise subprocess .CalledProcessError (1 , cmd )
330
-
331
-
332
- def get_pytest_timeout (timeout = None ):
333
- if timeout :
334
- return timeout
335
-
336
- try :
337
- import sys
338
- for i , arg in enumerate (sys .argv ):
339
- if arg == '--timeout' and i + 1 < len (sys .argv ):
340
- try :
341
- timeout = int (sys .argv [i + 1 ])
342
- except ValueError :
343
- pass
344
- elif arg .startswith ('--timeout=' ):
345
- try :
346
- timeout = int (arg .split ('=' , 1 )[1 ])
347
- except ValueError :
348
- pass
349
- if timeout and isinstance (timeout , (int , float )):
350
- return timeout
351
- except (ImportError , Exception ):
352
- pass
353
-
354
- return timeout
0 commit comments