I'm testing an web application and I've already written some tests using unittest. There are some necessary steps like authorization, exchanging data which are being tested and so on. Now I want to test if everything works fine for more then one client. Actually I'd like to call the same test for every client in seperate thread, gather all return codes and print result. My question is how to create such threads in python? (my ad hoc solution in bash spawns multiple python processes)
Let's consider an example:
import unittest
class Test(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testName(self):
pass
if __name__ == "__main__":
unittest.main()
thread.start_new_thread(unittest.main) #something like this does not work