Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
pip install -r dev_tools/requirements/envs/pytest.env.txt
pip install --no-deps -e .
- run: |
check/pytest --durations=10 -v -n=0
check/pytest-full --durations=10 -v -n=0
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
pip install -r dev_tools/requirements/envs/pytest.env.txt
pip install --no-deps -e .
- run: |
check/pytest -m 'not notebook and not slow'
check/pytest-quick

dev-tools:
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ checking formatting against the style guidelines. You can run those tools
locally during development. Wrapper scripts are located in the
[`check/`](./check/) subdirectory to simplify running the tools.

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

Expand Down
6 changes: 6 additions & 0 deletions check/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
cd "${topdir}" || exit $?

echo "Warning: running the full test suite, which may take tens of minutes."
echo ""
echo " To run the recommended test suite for development: use check/pytest-quick"
echo " To suppress this warning: use check/pytest-full"
echo ""

# Run in parallel by default. Pass the `-n0` option for a single-process run.
# (the last `-n` option wins)
PYTEST_ARGS=( "-n=auto" "$@" )
Expand Down
22 changes: 22 additions & 0 deletions check/pytest-full
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

################################################################################
# Runs the full pytest suite on the repository.
#
# Usage:
# check/pytest-full [--flags for pytest]
#
################################################################################

# Get the working directory to the repo root.
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
cd "$(git rev-parse --show-toplevel)" || exit 1

# Run in parallel by default. Pass the `-n0` option for a single-process run.
# (the last `-n` option wins)
PYTEST_ARGS=( "-n=auto" "$@" )

pytest "${PYTEST_ARGS[@]}" qualtran/
RESULT=$?

exit "$RESULT"
23 changes: 23 additions & 0 deletions check/pytest-quick
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

################################################################################
# Runs the quick pytest suite on the repository.
#
# This is the recommended set of unit tests for ordinary development.
#
# Usage:
# check/pytest-quick [--flags for pytest]
#
################################################################################

# Get the working directory to the repo root.
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
cd "$(git rev-parse --show-toplevel)" || exit 1

# Run in parallel by default. Pass the `-n0` option for a single-process run.
# (the last `-n` option wins)
PYTEST_ARGS=( "-n=auto" "-m" 'not slow and not notebook' "$@" )
pytest "${PYTEST_ARGS[@]}" qualtran/
RESULT=$?

exit "$RESULT"
Loading