docs: improve --lfnf docs to make functionality more clear

This commit is contained in:
Sean Malloy 2023-08-27 15:26:42 -07:00
parent b98d293fc0
commit 66e7a1f6bf
3 changed files with 11 additions and 2 deletions

View File

@ -185,6 +185,9 @@ using the ``--last-failed-no-failures`` option, which takes one of the following
pytest --last-failed --last-failed-no-failures all # run all tests (default behavior)
pytest --last-failed --last-failed-no-failures none # run no tests and exit
The ``--last-failed-no-failures`` option governs the behavior of ``--if``.
Default ``all`` runs all tests with no known failures. ``none`` avoids tests and exits successfully when there are no known failures.
The new config.cache object
--------------------------------

View File

@ -1894,7 +1894,10 @@ All the command-line flags can be obtained by running ``pytest --help``::
--lfnf={all,none}, --last-failed-no-failures={all,none}
Determines whether to execute tests when there
are no previously (known) failures or when no
cached ``lastfailed`` data was found
cached ``lastfailed`` data was found.
This option governs the behavior of ``--if``.
Default ``all`` runs all tests with no known failures.
``none`` avoids tests and exits if no failures.
--sw, --stepwise Exit on test failure and continue from last failing
test next time
--sw-skip, --stepwise-skip

View File

@ -500,7 +500,10 @@ def pytest_addoption(parser: Parser) -> None:
choices=("all", "none"),
default="all",
help="Determines whether to execute tests when there are no previously (known)"
"failures or when no cached ``lastfailed`` data was found",
"failures or when no cached ``lastfailed`` data was found."
"This option governs the behavior of ``--if``."
"Default ``all`` runs all tests with no known failures."
"``none`` avoids tests and exits if no failures.",
)