From b98d293fc0f62b166cc455bd146de4f35ecd13c0 Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Sat, 26 Aug 2023 13:56:29 -0700 Subject: [PATCH] docs: changing some docs for last-failed-no-failures to better explain functionality --- AUTHORS | 1 + doc/en/reference/reference.rst | 5 +++-- src/_pytest/cacheprovider.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 313e507f2..6fa7a41eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -336,6 +336,7 @@ Samuele Pedroni Sanket Duthade Sankt Petersbug Saravanan Padmanaban +Sean Malloy Segev Finer Serhii Mozghovyi Seth Junot diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index b172c3e9c..11da87651 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1892,8 +1892,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: tests. Optional argument: glob (default: '*'). --cache-clear Remove all cache contents at start of test run --lfnf={all,none}, --last-failed-no-failures={all,none} - Which tests to run with no previously (known) - failures + Determines whether to execute tests when there + are no previously (known) failures or when no + cached ``lastfailed`` data was found --sw, --stepwise Exit on test failure and continue from last failing test next time --sw-skip, --stepwise-skip diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 67dee6add..6d61c0dd0 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -499,7 +499,8 @@ def pytest_addoption(parser: Parser) -> None: dest="last_failed_no_failures", choices=("all", "none"), default="all", - help="Which tests to run with no previously (known) failures", + help="Determines whether to execute tests when there are no previously (known)" + "failures or when no cached ``lastfailed`` data was found", )