Is it possible to collect all the markers that are used with a particular test function along with marker arguments?
@pytest.mark.m1('abc')
@pytest.mark.skipif('True')
def test_1():
pass
I can collect all the tests with a particular marker using --collect-only -m marker_name.
However given a test function eg. test_1 I want the list of markers i.e. [m1('abc') , skipif('True')].
Thanks in advance!
@thakkardharmik there is no cli option to do it,
but given the test items for the makers you can do list(item.iter_markers()) or list(item.iter_markers_with_node())
@thakkardharmik does this resolve your issue? please follow up by closing or adding more information/questions so we can follow up thereafter
@RonnyPfannschmidt Thanks alot! This works for me.
Most helpful comment
@thakkardharmik there is no cli option to do it,
but given the test items for the makers you can do
list(item.iter_markers())orlist(item.iter_markers_with_node())