Skip to content

Commit

Permalink
Modify Software Tests page of the developer's guide to be requirement…
Browse files Browse the repository at this point in the history
…s-agnostic (#5765)

A duplicate of
[#5740](#5740) due to doc
building issues.

Modify Software Tests page of the developer's guide to be
requirements-agnostic

**Context:**
Software Tests page was outdated and relied on listing the testing
requirements instead of relying on the continuously updated
`requirements-dev.txt` file.

**Description of the Change:**
Instructions for installing the development requirements was added to
the Installation page and the Requirements section of Software Tests has
been modified to be more informative rather than instructive.

**Benefits:**
Less overhead to update the guide later if deps are added/removed.

[[sc-63429](https://app.shortcut.com/xanaduai/story/63429)]

---------

Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
  • Loading branch information
Shiro-Raven and trbromley authored May 30, 2024
1 parent 856b14e commit 7a4a92a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions doc/development/guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ importing PennyLane in Python.
requires ``pip install -e .`` to be re-run in the plugin repository
for the changes to take effect.

Apart from the core packages needed to run PennyLane. Some extra packages need
to be installed for several development processes, such as linting, testing, and
pre-commit quality checks. Those can be installed easily via ``pip``:

.. code-block:: bash
pip install -r requirements-dev.txt
Docker
------

Expand Down
12 changes: 6 additions & 6 deletions doc/development/guide/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ Software tests

Requirements
~~~~~~~~~~~~
The PennyLane test suite requires the Python ``pytest`` package, as well as:
The PennyLane test suite requires the Python ``pytest`` package, as well as
some extentions thereof, for example:

* ``pytest-cov``: determines test coverage
* ``pytest-mock``: allows replacing components with dummy/mock objects
* ``flaky``: manages tests with non-deterministic behaviour
* ``pytest-benchmark``: benchmarks the performance of functions, and can be used to ensure consistent runtime
* ``pytest-xdist``: currently used to force some tests to run on the same thread to avoid race conditions

These requirements can be installed via ``pip``:

.. code-block:: bash
pip install pytest pytest-cov pytest-mock flaky
If you properly followed the :doc:`installation guide <./installation>`, you should have all of these packages and others installed in your
environment, so you can go ahead and put your code to the test!

Creating a test
~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 7a4a92a

Please sign in to comment.