How to run TeamCity's python runner with multiple files?

1k views Asked by At

I write unittests in Python using TeamCity Runner. Up until now all the tests were in same file, and the line of code that ran the tests in main was:

unittest.main(testRunner=TeamcityTestRunner())

Now, I have several files of tests, and I want the team city runner the run a suite. I saw something like:

loader = unittest.TestLoader()

suite = loader.loadTestsFromModule(test_something)
suite.addTests(loader.loadTestsFromModule(test_something2))
suite.addTests(loader.loadTestsFromModule(test_something3))

runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)

but as you can see in the first code piece, I do not call runner.run() myself but calling a TeamCityTestRunner().

And idea how can I tell TeamCityTestRunner to run a suite of tests (few different files) ?

0

There are 0 answers