Can I call a test method from within the test class in python? For example:


class Test(unittest.TestCase):
    def setUp(self):
        #do stuff

    def test1(self):
        self.test2()

    def test2(self):
        #do stuff


update: I forgot the other half of my question. Will setup or teardown be called only after the method that the tester calls? Or will it get called between test1 entering and after calling test2 from test1?
All methods whose name begins with the string 'test' are considered unit tests (i.e. they get run when you call unittest.main()). So you can call methods from within the Test class, but you should name it something that does not start with the string 'test' unless you want it to be also run as a unit test.
python unittest methods