Skip to content

Commit

Permalink
Use nosetests if python3 is not available
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Styk <[email protected]>
  • Loading branch information
StykMartin committed Nov 17, 2023
1 parent 7164abf commit 355cb0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
15 changes: 6 additions & 9 deletions Client/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#/bin/bash
#!/bin/bash

set -x

# Use Python 2 version if BKR_PY3 is not defined
if [[ -z ${BKR_PY3} ]]; then
pytest_command="py.test-2";
elif [[ ${BKR_PY3} == 1 ]]; then
pytest_command="pytest-3";
# Use nosetests with python2 interpreter
if [[ -z ${BKR_PY3} ]] || [[ ${BKR_PY3} != 1 ]]; then
command="nosetests ${*:--v --traverse-namespace bkr.client.tests}";
else
pytest_command="py.test-2";
command="pytest-3";
fi

env PYTHONPATH=../Client/src:../Common${PYTHONPATH:+:$PYTHONPATH} \
$pytest_command
env PYTHONPATH=../Client/src:../Common${PYTHONPATH:+:$PYTHONPATH} "$command"
13 changes: 5 additions & 8 deletions Common/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

set -x

# Use Python 2 version if BKR_PY3 is not defined
if [[ -z ${BKR_PY3} ]]; then
pytest_command="py.test-2";
elif [[ ${BKR_PY3} == 1 ]]; then
pytest_command="pytest-3";
# Use nosetests with python2 interpreter
if [[ -z ${BKR_PY3} ]] || [[ ${BKR_PY3} != 1 ]]; then
command="nosetests ${*:--v bkr}";
else
pytest_command="py.test-2";
command="pytest-3";
fi

env PYTHONPATH=../Client/src:../Common${PYTHONPATH:+:$PYTHONPATH} \
$pytest_command
env PYTHONPATH=../Client/src:../Common${PYTHONPATH:+:$PYTHONPATH} "$command"

0 comments on commit 355cb0d

Please sign in to comment.