Skip to content

Commit 48eeaf9

Browse files
committed
docs: mention using pytest from the operating system
Some projects intentionally use the distribution's pytest instead of a virtual environment; describe that case separately from the default recommendation, as discussed in review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent fdb318c commit 48eeaf9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎doc/en/explanation/goodpractices.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ together with the ``dev`` group, by running from the same directory:
8282
8383
which lets you change your source code (both tests and application) and rerun tests at will.
8484

85+
.. _`system-pytest`:
86+
87+
Using pytest from the operating system
88+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89+
90+
Some projects deliberately use the ``pytest`` provided by the operating system,
91+
for example to test software that is itself built and packaged by a distribution,
92+
or where a test suite only needs ``pytest`` to be available as a command.
93+
In that case install ``pytest`` with the system package manager
94+
(for example ``apt install python3-pytest`` or ``dnf install python3-pytest``),
95+
not with ``pip`` into the system Python.
96+
The version is then the one your distribution ships, which may be older than the latest release.
97+
8598
.. _`test discovery`:
8699
.. _`Python test discovery`:
87100

0 commit comments

Comments
 (0)