-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors
Description
When a fixture docstring has varying levels of indentation pytest --fixtures
drops the indentation completely. For example:
import pytest
@pytest.fixture(scope="module")
def foo(request):
"""
Use the foo to foo the foo like this::
foo("foo")
"""
calling python -mpytest test_foo.py --fixtures
outputs:
================= test session starts ======================
...
------------ fixtures defined from test_foo ----------------
foo
Use the foo to foo the foo like this::
foo("foo")
=============== no tests ran in 0.03 seconds ===============
However I would have expected this to output:
================= test session starts ======================
...
------------ fixtures defined from test_foo ----------------
foo
Use the foo to foo the foo like this::
foo("foo")
=============== no tests ran in 0.03 seconds ===============
i.e. only the smallest indentation level should be stripped away (except maybe for the first line that requires special treatment).
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors