Skip to content

inaccurate documentation #7336

@shilobar

Description

@shilobar

In https://docs.pytest.org/en/5.4.3/reference.html, under "log_file", it says: "Sets a file name relative to the pytest.ini file"

Instead, the log file is created relative to the directory where pytest was invoked.

I ran pytest _test.py in a subdirectory, with a pytest.ini a few directories above it, with the following config:

[pytest]
python_files = _test*.py
testpaths = lib
log_cli = True
log_cli_level = DEBUG
log_file = pytest-logs.txt
log_file_level = DEBUG

A pytest-logs.txt was created in the directory where I ran pytest.

I'm running:
pytest 5.4.3
macOs 10.15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorplugin: loggingrelated to the logging builtin plugintype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions