I have several modules full of test-cases and开发者_如何学Go would like to create one module that runs them all. I tried loading the tests in each of the modules using TestLoader.loadTestFromModule
, but it always returns empty test-suites. What is the easiest way to achieve this?
Have a look at nose. It can also be called programmatically, and it may thus be used to call your tests once you've configured it.
Ok, the problem there was that I handed in the modules-names as strings, when I should have been handing in module-objects like this:
import unittest
import SomeTestModule
loader = unittest.TestLoader()
loader.loadTestsFromModule(SomeTestModule)
Really a beginners mistake.
精彩评论