Closed
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).