Suppose I have a unittest like this
class TestABC(unittest.TestCase):
def setUp(self):
....
def test001_abc(self):
....
def test002_abc(self):
....
def test003_bac(self):
....
self.test001_abc()
But the output shows Run 3 tests in 10.962s. I believe that the last self.test001_bac() had been ran, but can we indicate this in the test count?
Thanks.
The last “test” was run as part of test_003_bac, so unittest does not see it as a separate test. I’m not sure what you’re trying to achieve with this, but running one test inside another is not a good idea. nose supports the concept of Test Generators, which might do what you want.