vendredi 14 février 2020

multiple test runners unittest python Teamcity runner and Htmlrunner

if __name__ == '__main__':
    if is_running_under_teamcity():
        runner = TeamcityTestRunner()
    else:
        runner =  HTMLTestRunner.HTMLTestRunner(
                stream=outfile,
                title='Test Report',
                description='This is an example.'
                )
    unittest.main(testRunner=runner)

I am currently running some tests using unittest module in python this is my current code above. I am deploying this test setup on Teamcity, the first module allows me to convert the output into teamcity-messages and the second creates a html report of the results. Is there a way I can run both of these runners while only running one set of tests? The only option I can see at the minuete is to either try and combine both these modules into a hybrid or using another testing module that Teamcity supports, however I would like to keep the dependancies as low as possible

Any ideas would be great :)

Aucun commentaire:

Enregistrer un commentaire