Skip to content

Commit 0196738

Browse files
authored
Small housekeeping in check/pytest (#5899)
- Clean up special-casing for Python 3.6 as we require Python 3.7. - Simplify handling of the parallel job count `-n COUNT` option in check/pytest. Obey the `-n0` option on the command line in addition to `-n 0` to request non-parallel testing.
1 parent c875124 commit 0196738

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

check/pytest

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,11 @@
1515
cd "$(dirname "${BASH_SOURCE[0]}")"
1616
cd "$(git rev-parse --show-toplevel)"
1717

18-
PYTEST_ARGS=()
19-
20-
PARALLEL=""
21-
for arg in "$@"; do
22-
if [[ "${arg}" == "-n" ]]; then
23-
PARALLEL=1
24-
fi
25-
PYTEST_ARGS+=("${arg}")
26-
done
27-
28-
if [ -z "${PARALLEL}" ]; then
29-
PYTEST_ARGS+=("-n=auto")
30-
fi
18+
# Run in parallel by default. Pass the `-n0` option for a single-process run.
19+
# (the last `-n` option wins)
20+
PYTEST_ARGS=( "-n=auto" "$@" )
3121

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

3824
pytest "${PYTEST_ARGS[@]}"
3925
RESULT=$?

0 commit comments

Comments
 (0)