mardi 28 juin 2016

Unittest __unittest_skip__ access in beforeTest method

I am using the skip decorator for a test:

@skip('I want this to skip')
def test_abc(self):

I also have a nose plugin to report test results with a defined

def beforeTest(self, *args, **kwargs):

the test case test_abc is getting captured by the beforeTest method. How can I check for the decorator value in my beforeTest method?

I see that the definition of unittest decorator has the following code:

test_item.__unittest_skip__ = True
test_item.__unittest_skip_why__ = reason

But I dont know how to access it from beforeTest. When running args[0].test has the test case object but I can seem to find where __unittest_skip__ is defined

Thanks!

Aucun commentaire:

Enregistrer un commentaire