Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous quotes in tmp_path_retention_policy example in docs #12678

Closed
RFCArrow opened this issue Aug 1, 2024 · 0 comments · Fixed by #12679
Closed

Erroneous quotes in tmp_path_retention_policy example in docs #12678

RFCArrow opened this issue Aug 1, 2024 · 0 comments · Fixed by #12679

Comments

@RFCArrow
Copy link

RFCArrow commented Aug 1, 2024

pytest: 8.3.2
OS: Ubuntu 22.04

doc/en/reference/reference.rst contains the following example for tmp_path_retention_policy

.. confval:: tmp_path_retention_policy



   Controls which directories created by the `tmp_path` fixture are kept around,
   based on test outcome.

    * `all`: retains directories for all tests, regardless of the outcome.
    * `failed`: retains directories only for tests with outcome `error` or `failed`.
    * `none`: directories are always removed after each test ends, regardless of the outcome.

   .. code-block:: ini

        [pytest]
        tmp_path_retention_policy = "all"

However, if the example value tmp_path_retention_policy = "all" is used in pytest.ini then the following error is encountered:

INTERNALERROR> ValueError: tmp_path_retention_policy must be either all, failed, none. Current input: "all".

This error is avoided if the value is not wrapped in quotes: tmp_path_retention_policy = all

I believe the docs should be updated to remove the erroneous quotes in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant