I have a script that acts as a wrapper for some unit tests written using the Python unittest module. In addition to cleaning up some files, creating an output s
If you define the attributes in the init method, then you can simply pass them all in the constructor like this..
import unittest
import helpspot
class TestHelpSpot(unittest.TestCase):
"A few simple tests for HelpSpot"
def __init__(self, testname, path, user, pword):
super(TestHelpSpot, self).__init__(testname)
self.path = path
self.user = user
self.pword = pword
....
....
....
if __name__ == '__main__':
True
suite = unittest.TestSuite()
suite.addTest(TestHelpSpot("test_version", path, user, pword))
unittest.TextTestRunner().run(suite)