Just a remark: you could check any available tool in $PATH via $(which toolname) and decide in an if statement which one to choose by pointing it to a wrapper variable.
Something according to that: (untested!)
PYTEST=$(which pytest)
PYTEST3=$(which pytest-3)
if [ ! -z ${PYTEST} ]; then
TESTTOOL= ${PYTEST}
elif [ ! -z ${PYTEST3} ]; then
TESTTOOL= ${PYTEST3}
else
# print error message -> no pytest found at all
fi
[...]
${TESTTOOL} ... ## using pytest only via that wrapper variable
Just a remark: you could check any available tool in $PATH via $(which toolname) and decide in an if statement which one to choose by pointing it to a wrapper variable.
Something according to that: (untested!)