From 18fea1ea859f6c12c0f16b18b2d24f4d6b6d9981 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 25 Feb 2026 13:04:34 +0100 Subject: [PATCH] Fix calling PyTest interpreter Signed-off-by: Petr "Stone" Hracek --- test/run-openshift-pytest | 10 +++++----- test/run-pytest | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/run-openshift-pytest b/test/run-openshift-pytest index 6a607db8..a0f455a7 100755 --- a/test/run-openshift-pytest +++ b/test/run-openshift-pytest @@ -7,9 +7,9 @@ # THISDIR=$(dirname ${BASH_SOURCE[0]}) -PYTHON_VERSION="3.12" -if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then - PYTHON_VERSION="3.13" +if python3 -c 'import sys; sys.exit(0 if sys.version_info < (3,13) else 1)'; then + PYTHON_VERSION="3.12" +else + PYTHON_VERSION="3" fi - -cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_ocp_*.py +cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_ocp_*.py diff --git a/test/run-pytest b/test/run-pytest index 35fca679..712e47a8 100755 --- a/test/run-pytest +++ b/test/run-pytest @@ -8,8 +8,9 @@ THISDIR=$(dirname ${BASH_SOURCE[0]}) -PYTHON_VERSION="3.12" -if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then - PYTHON_VERSION="3.13" +if python3 -c 'import sys; sys.exit(0 if sys.version_info < (3,13) else 1)'; then + PYTHON_VERSION="3.12" +else + PYTHON_VERSION="3" fi cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_container_*.py