<p dir="ltr">Dear pytest users and maintainers,</p>
<p dir="ltr">my ideal custom marker definition/registration would look like this in conftest.py:</p>
<p dir="ltr">@pytest.marker<br>
def name(request, parg0, ..., kwarg0="default", ...):<br>
"""marker documentation"""<br>
assert ..., "Mark args not used correctly"</p>
<p dir="ltr">The decorator would be in charge of registration (instead of pytest.ini).</p>
<p dir="ltr">The function would be called at collection time for each marking.</p>
<p dir="ltr">The request param could be used for collecting meta data that could be<br>
retrieved later. Example:</p>
<p dir="ltr">@pytest.marker<br>
def verifies(request, requirement):<br>
....</p>
<p dir="ltr">....</p>
<p dir="ltr">@verifies("Requirement 42")<br>
def test_42():<br>
assert False</p>
<p dir="ltr">....</p>
<p dir="ltr">$ py.test . --show-verifications<br>
test_42 vierifies Requirement 42<br></p>
<p dir="ltr">By reading the fine manual I assume that this would be a feature request.<br>
What would come closest to it using the current pytest?</p>
<p dir="ltr">TIA<br>
Stony<br>
</p>