Skip to content

Commit 2a76073

Browse files
committed
pytest-quick
1 parent 8c7d05b commit 2a76073

6 files changed

Lines changed: 36 additions & 3 deletions

File tree

.github/workflows/nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343
pip install -r dev_tools/requirements/envs/pytest.env.txt
4444
pip install --no-deps -e .
4545
- run: |
46-
check/pytest --durations=10 -v -n=0
46+
check/pytest-full --durations=10 -v -n=0

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
pip install -r dev_tools/requirements/envs/pytest.env.txt
4242
pip install --no-deps -e .
4343
- run: |
44-
check/pytest -m 'not notebook and not slow'
44+
check/pytest-quick
4545
4646
dev-tools:
4747
runs-on: ubuntu-24.04

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ checking formatting against the style guidelines. You can run those tools
7676
locally during development. Wrapper scripts are located in the
7777
[`check/`](./check/) subdirectory to simplify running the tools.
7878

79-
* Run `check/pytest` to run the Pytest suite
79+
* Run `check/pytest-quick` to run the Pytest suite
8080
* Run `check/mypy` to run the Mypy type checker
8181
* Run `check/pylint` to run the Pylint code linter
8282

check/pytest

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
1313
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
1414
cd "${topdir}" || exit $?
1515

16+
echo "Warning: running the full test suite, which may take tens of minutes."
17+
echo ""
18+
echo " To run the recommended test suite for development: use check/pytest-quick"
19+
echo " To suppress this warning: use check/pytest-full"
20+
echo ""
21+
1622
# Run in parallel by default. Pass the `-n0` option for a single-process run.
1723
# (the last `-n` option wins)
1824
PYTEST_ARGS=( "-n=auto" "$@" )

check/pytest-full

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the working directory to the repo root.
4+
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
5+
cd "$(git rev-parse --show-toplevel)" || exit 1
6+
7+
# Run in parallel by default. Pass the `-n0` option for a single-process run.
8+
# (the last `-n` option wins)
9+
PYTEST_ARGS=( "-n=auto" "$@" )
10+
11+
pytest "${PYTEST_ARGS[@]}" qualtran/
12+
RESULT=$?
13+
14+
exit "$RESULT"

check/pytest-quick

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the working directory to the repo root.
4+
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
5+
cd "$(git rev-parse --show-toplevel)" || exit 1
6+
7+
# Run in parallel by default. Pass the `-n0` option for a single-process run.
8+
# (the last `-n` option wins)
9+
PYTEST_ARGS=( "-n=auto" "-m" 'not slow and not notebook' "$@" )
10+
pytest "${PYTEST_ARGS[@]}" qualtran/
11+
RESULT=$?
12+
13+
exit "$RESULT"

0 commit comments

Comments
 (0)