I'm new with python, and I'm trying to create my own test suite.
The main pourpose is to execute the same test on different browser, that's why I used the variable browser, that is used within the test to call the webdriver.
I have this:
def test_01(self,browser):
def test_02(self,browser):
my Suite:
def suite():
test_suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Test01))
return test_suite
main:
if __name__ == "__main__":
suite1 = unittest.TestSuite()
self = Test01()
suite1.addTest(Test01.test_01(self, 'firefox'))
suite1.addTest(Test01.test_02(self, 'firefox'))
unittest.TextTestRunner(verbosity=2).run(suite())
When I try to execute that script, the first one test is execute, the second one not, and I got the following error:
Traceback (most recent call last): File "SuiteWebMail.py", line 138, in suite1.addTest(Test01.test_01(self, 'firefox')) File "c:\Python34\lib\unittest\suite.py", line 50, in addTest raise TypeError("{} is not callable".format(repr(test))) TypeError: None is not callable
Thank you in advance
C