Strip docstrings in output with --fixtures

Fixes https://bitbucket.org/pytest-dev/pytest/issue/550.

--HG--
branch : strip-docstrings-from-fixtures
This commit is contained in:
Daniel Hahler
2015-03-04 17:00:24 +01:00
parent 41e6b04f0b
commit 5d6b0a59c0
2 changed files with 32 additions and 2 deletions

View File

@@ -979,7 +979,7 @@ def _showfixtures_main(config, session):
loc = getlocation(fixturedef.func, curdir)
doc = fixturedef.func.__doc__ or ""
if doc:
for line in doc.split("\n"):
for line in doc.strip().split("\n"):
tw.line(" " + line.strip())
else:
tw.line(" %s: no docstring available" %(loc,),