New. Print doctstrings upon execution

This commit is contained in:
Dima Molodenskiy
2023-10-24 20:34:30 +02:00
parent dba0f4c089
commit 457aa43d3e

10
test/conftest.py Executable file
View File

@@ -0,0 +1,10 @@
import pytest
@pytest.mark.tryfirst
def pytest_itemcollected(item):
par = item.parent.obj
node = item.obj
pref = par.__doc__.strip() if par.__doc__ else par.__class__.__name__
suf = node.__doc__.strip() if node.__doc__ else node.__name__
if pref or suf:
item._nodeid = ' '.join((pref, suf))