Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing run-tests.py mentions #4628

Merged
merged 3 commits into from
Nov 28, 2024
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
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Please add a line in the relevant section of [CHANGELOG.md](https://github.com/p
# Key checklist:

- [ ] No style issues: `$ pre-commit run` (or `$ nox -s pre-commit`) (see [CONTRIBUTING.md](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md#installing-and-using-pre-commit) for how to set this up to run automatically when committing locally, in just two lines of code)
- [ ] All tests pass: `$ python run-tests.py --all` (or `$ nox -s tests`)
- [ ] The documentation builds: `$ python run-tests.py --doctest` (or `$ nox -s doctests`)
- [ ] All tests pass: `$ python -m pytest` (or `$ nox -s tests`)
- [ ] The documentation builds: `$ python -m pytest --doctest-plus src` (or `$ nox -s doctests`)

You can run integration tests, unit tests, and doctests together at once, using `$ python run-tests.py --quick` (or `$ nox -s quick`).
You can run integration tests, unit tests, and doctests together at once, using `$ nox -s quick`.

## Further checks:

Expand Down
18 changes: 7 additions & 11 deletions docs/source/user_guide/installation/install-from-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,31 +237,27 @@ Finally, to run the unit and the integration suites sequentially, use

nox -s tests

Using the test runner
Using pytest
~~~~~~~~~~~~~~~~~~~~~~

You can run unit tests for PyBaMM using

.. code:: bash

# in the PyBaMM/ directory
python run-tests.py --unit
pytest -m unit


The above starts a sub-process using the current python interpreter (i.e. using your current
Python environment) and run the unit tests. This can take a few minutes.
The above uses pytest (in your current
Python environment) to run the unit tests. This can take a few minutes.

You can also use the test runner to run the doctests:
You can also use pytest to run the doctests:

.. code:: bash

python run-tests.py --doctest
pytest --doctest-plus src

There is more to the PyBaMM test runner. To see a list of all options, type

.. code:: bash

python run-tests.py --help
Refer to the `testing <https://docs.pybamm.org/en/stable/source/user_guide/contributing.html#testing>`_ docs to find out more ways to test PyBaMM using pytest.

How to build the PyBaMM documentation
-------------------------------------
Expand Down