Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions check/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,11 @@
cd "$(dirname "${BASH_SOURCE[0]}")"
cd "$(git rev-parse --show-toplevel)"

PYTEST_ARGS=()

PARALLEL=""
for arg in "$@"; do
if [[ "${arg}" == "-n" ]]; then
PARALLEL=1
fi
PYTEST_ARGS+=("${arg}")
done

if [ -z "${PARALLEL}" ]; then
PYTEST_ARGS+=("-n=auto")
fi
# Run in parallel by default. Pass the `-n0` option for a single-process run.
# (the last `-n` option wins)
PYTEST_ARGS=( "-n=auto" "$@" )

source dev_tools/pypath
PYTHON_VERSION=$(python -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]\).*/\1\2/')
if [ "$PYTHON_VERSION" -lt "37" ]; then
PYTEST_ARGS+=("--ignore=cirq-rigetti")
fi

pytest "${PYTEST_ARGS[@]}"
RESULT=$?
Expand Down