Skip to content

Commit 0a559ec

Browse files
committed
testlib: Fix hanging tests
When I run $ MITOGEN_LOG_LEVEL=debug SKIP_ANSIBLE=1 ./run_tests -v -k first_stage_test.CommandLineTest in a interactive Shell (with a tty), it ends in a hanging process as the `have_python2` and `have_python3` ends up ends up in an interactive Python shell. Therefore check the Python version instead. Signed-off-by: Marc Hartmayer <[email protected]>
1 parent 7be79d0 commit 0a559ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/testlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ def _have_cmd(args):
172172

173173

174174
def have_python2():
175-
return _have_cmd(['python2'])
175+
return _have_cmd(['python2', '--version'])
176176

177177

178178
def have_python3():
179-
return _have_cmd(['python3'])
179+
return _have_cmd(['python3', '--version'])
180180

181181

182182
def have_sudo_nopassword():

0 commit comments

Comments
 (0)