Skip to content

Commit

Permalink
tests/run-test.sh: Fall back from pytest-3 to pytest
Browse files Browse the repository at this point in the history
Back in a time of transition from Python 2 to 3, pytest-3 was an
indicator to use the Python 3 edition. However, this is no longer the
case, and if pytest-3 still exists, it's only for compatibility reasons.

Fall back to the canonical pytest if pytest-3 doesn't exist. This is the
same behavior as in our meson.build.
  • Loading branch information
swick authored and smcv committed Feb 17, 2025
1 parent 8c3af12 commit 1de3938
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function fail()

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

PYTEST=$(command -v "pytest-3" || command -v "pytest") || fail "pytest is missing"

BUILDDIR=${BUILDDIR:-$(find "${SCRIPT_DIR}/.." -maxdepth 2 -name 'build.ninja' -printf "%h\n" -quit)}

[ ! -f "${BUILDDIR}/build.ninja" ] && fail "Path '${BUILDDIR}' does not appear to be a build dir"
Expand All @@ -39,4 +41,4 @@ export XDG_DESKTOP_PORTAL_PATH="$BUILDDIR/src/xdg-desktop-portal"
export XDG_DOCUMENT_PORTAL_PATH="$BUILDDIR/document-portal/xdg-document-portal"
export XDG_PERMISSION_STORE_PATH="$BUILDDIR/document-portal/xdg-permission-store"

exec pytest-3 "$@"
exec "$PYTEST" "$@"

0 comments on commit 1de3938

Please sign in to comment.