File: run_pytest.sh

package info (click to toggle)
python-easy-ansi 0.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 488 kB
  • sloc: python: 3,109; sh: 127; makefile: 2
file content (34 lines) | stat: -rwxr-xr-x 732 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

# This script is used for running the PyTest tests

source ./config.sh

# This can be a directory
PYTEST_FILE=""

if [ $# -ne 0 ]
then
    if [ $# -eq 1 ]
    then
        PYTEST_FILE="${1}"
        if [ ! -e "${TESTS_DIR}/${PYTEST_FILE}" ]
        then
            echo "PyTest file or dir not found: ${TESTS_DIR}/${PYTEST_FILE}"
            exit 1
        fi
    else
        echo "Too many parameters, only 1 optionally allowed."
        exit 1
    fi
fi

"${CONDA_BIN_DIR}/activate" "${CONDA_DEV_ENV}"
cd "${DEV_DIR}"
pip install -e .
echo ""
echo "----- PyTest Starts Below -----"

# -s(--capture=no): let's sysout show on screen
# --verbose
python -m pytest --rootdir="${TESTS_DIR}" "${TESTS_DIR}/${PYTEST_FILE}"