From ad3a3fecbc58ec0ba6f8f63355c97561e945ad88 Mon Sep 17 00:00:00 2001 From: Pradyot Ranjan <99216956+prady0t@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:03:06 +0530 Subject: [PATCH] Removing `run-tests.py` mentions (#4628) * Removing mentions of run-tests.py Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> * Usin pytest instead of run-tests mentions Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> --------- Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Co-authored-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Co-authored-by: Eric G. Kratz --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++--- .../installation/install-from-source.rst | 18 +++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4c6f9bd6c6..b44a4b33cb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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: diff --git a/docs/source/user_guide/installation/install-from-source.rst b/docs/source/user_guide/installation/install-from-source.rst index ea664b4a5b..f4d60ee9a8 100644 --- a/docs/source/user_guide/installation/install-from-source.rst +++ b/docs/source/user_guide/installation/install-from-source.rst @@ -237,7 +237,7 @@ 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 @@ -245,23 +245,19 @@ 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 `_ docs to find out more ways to test PyBaMM using pytest. How to build the PyBaMM documentation -------------------------------------