git: 1f5415db25 - main - [phb]: Document USES=pytest

Fernando Apesteguía <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/doc/commit/?id=1f5415db2575959d70e41f9385233322b27c507d

commit 1f5415db2575959d70e41f9385233322b27c507d
Author:     Fernando Apesteguía <[email protected]>
AuthorDate: 2022-04-21 11:48:56 +0000
Commit:     Fernando Apesteguía <[email protected]>
CommitDate: 2022-04-21 12:03:54 +0000

    [phb]: Document USES=pytest
    
    Stadarized way of running pytest.
    
    Follow-up for
    https://cgit.FreeBSD.org/ports/commit/?id=b731fff69c0ffd79f80f5d1d575e016337f3b920
---
 .../en/books/porters-handbook/uses/_index.adoc     | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/documentation/content/en/books/porters-handbook/uses/_index.adoc b/documentation/content/en/books/porters-handbook/uses/_index.adoc
index c5c967ac48..522c2f8155 100644
--- a/documentation/content/en/books/porters-handbook/uses/_index.adoc
+++ b/documentation/content/en/books/porters-handbook/uses/_index.adoc
@@ -1367,6 +1367,40 @@ USES=		pyqt
 USE_PYQT=	core doc_build designer_run
 ....
 
+[[uses-pytest]]
+== `pytest`
+
+Possible arguments: (none), 4
+
+Introduces a new dependency on package:devel/pytest[]. It defines a `do-test`
+target which will run the tests properly. If your port uses package:devel/pytest[]
+consider using this before rolling your own `do-test` target. The framework
+exposes the following variables to the port:
+
+`PYTEST_ARGS`::
+Additional arguments to pytest (defaults to empty).
+
+`PYTEST_IGNORED_TESTS`::
+lists of `pytest -k` patterns of tests to ignore (defaults to empty). For tests
+which are not expected to pass, such as ones requiring a database access.
+
+`PYTEST_BROKEN_TESTS`::
+lists of `pytest -k` patterns of tests to ignore (defaults to empty). For broken
+tests which require fixing.
+
+In addition the following variables may be set by the user:
+
+`PYTEST_ENABLE_IGNORED_TESTS`::
+Enable tests which are otherwise ignored by `PYTEST_IGNORED_TESTS`.
+
+`PYTEST_ENABLE_BROKEN_TESTS`::
+Enable tests which are otherwise ignored by `PYTEST_BROKEN_TESTS`.
+
+`PYTEST_ENABLE_ALL_TESTS`::
+Enable tests which are otherwise ignored by `PYTEST_IGNORED_TESTS` and
+`PYTEST_BROKEN_TESTS`.
+
+
 [[uses-python]]
 == `python`
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.