Skip to content

Commit 7ee248c

Browse files
phracekpkhartsk
authored andcommitted
Fix calling PyTest interpreter
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 1dd78ee commit 7ee248c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

test/run-openshift-pytest

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#
88

99
THISDIR=$(dirname ${BASH_SOURCE[0]})
10-
PYTHON_VERSION="3.12"
11-
if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then
12-
PYTHON_VERSION="3.13"
10+
if python3 -c 'import sys; sys.exit(0 if sys.version_info < (3,13) else 1)'; then
11+
PYTHON_VERSION="3.12"
12+
else
13+
PYTHON_VERSION="3"
1314
fi
14-
15-
cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_ocp_*.py
15+
cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_ocp_*.py

test/run-pytest

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
THISDIR=$(dirname ${BASH_SOURCE[0]})
1010

11-
PYTHON_VERSION="3.12"
12-
if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then
13-
PYTHON_VERSION="3.13"
11+
if python3 -c 'import sys; sys.exit(0 if sys.version_info < (3,13) else 1)'; then
12+
PYTHON_VERSION="3.12"
13+
else
14+
PYTHON_VERSION="3"
1415
fi
1516
cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_container_*.py

0 commit comments

Comments
 (0)