diff --git a/test/run-openshift-pytest b/test/run-openshift-pytest index fad21c89..5d1e04f9 100755 --- a/test/run-openshift-pytest +++ b/test/run-openshift-pytest @@ -8,4 +8,11 @@ THISDIR=$(dirname ${BASH_SOURCE[0]}) -cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_ocp_*.py +git show -s + +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_ocp_*.py diff --git a/test/run-pytest b/test/run-pytest index 35fca679..69484a06 100755 --- a/test/run-pytest +++ b/test/run-pytest @@ -8,8 +8,11 @@ THISDIR=$(dirname ${BASH_SOURCE[0]}) -PYTHON_VERSION="3.12" -if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then - PYTHON_VERSION="3.13" +git show -s + +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