Skip to content Skip to sidebar Skip to footer

Is There A Way For A Python Nose Test To Know Its Decorated Attributes?

I have some tests like: @attr('sanity', 'someothertag') def test_this_important_feature(self): '''Comment - Verify the very imporant feature I'm wondering if there's a way to

Solution 1:

Attributes are directly available as a dictionary of the function, i.e. test_this_important_feature.__dict__ will have all the attributes. Have a look at get_attr_dict() in this answer, if you do not want to hardcode the name of the function. For the second part of the answer, you may also expand on for fancy printout


Post a Comment for "Is There A Way For A Python Nose Test To Know Its Decorated Attributes?"