From 0a559ec8d861f691578ac28686c235090f43d43d Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 9 Dec 2025 09:34:59 +0000 Subject: [PATCH] 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 --- tests/testlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testlib.py b/tests/testlib.py index 15016964..e9104000 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -172,11 +172,11 @@ def _have_cmd(args): def have_python2(): - return _have_cmd(['python2']) + return _have_cmd(['python2', '--version']) def have_python3(): - return _have_cmd(['python3']) + return _have_cmd(['python3', '--version']) def have_sudo_nopassword():