Replies: 1 comment
|
Your custom hook also creates a decorator but never applies the argument-bearing marker. Make it run before pytest-bdd's default hook, decorate the function, and return @pytest.hookimpl(tryfirst=True)
def pytest_bdd_apply_tag(tag, function):
if tag == "mymarker":
pytest.mark.mymarker("A custom argument")(function)
return True
def pytest_collection_modifyitems(items):
for item in items:
marker = item.get_closest_marker("mymarker")
if marker is None:
continue # emit your warning here
custom_arg = marker.args[0]I reproduced this on pytest-bdd 8.1.0: a normal feature tag appears in |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
Using
pytestonly, I am reading test markers thanks to thepytesthookpytest_collection_modifyitems:But it seems that
@tagsfromfeaturefiles are not inown_markers😞According to my tests,
own_markersis empty.Am I missing something ?
My actual usecase is to combine
pytest_bdd_apply_tagandpytest_collection_modifyitems:(this is a dummy example)
Thank you for your help!
All reactions