mardi 22 septembre 2015

Python - How to add a standard validation in the base class

I have a number of unit tests that extends a base class.

I want to add a validate condition to all testcases. I know I can do in each test

def validate(self):
    # The base validation 
    BaseTest.validate(self)

    # This test validation 
    self.assertGrep(file='correlator.log', exprList='TEST PASSED')

Is there a way I can do this only by modifying the base class and without having to modify all testcases?

Or is it something that needs to be done in a Runner extension?

Aucun commentaire:

Enregistrer un commentaire