0

I want to pass some parameters to my unittest class.

class test_login(unittest.TestCase):
   
    def setUpClass(self):
        self.driver = webdriver.Remote(ip)

How can I call TestCase class, each time with one of the IP in my server_ip list

server_ip = [ 'ip1' , 'ip2' ] 
  • Why are you trying to use `setUpClass` for instance state? – user2357112 Nov 12 '20 at 10:35
  • my testcase class has two function (def test_login(self) and def test_logout(self) ). I use setupClass to set IP. actually, I want to test Login and Logout into the two webservers. – shahriar Dehghani Nov 12 '20 at 10:47
  • 1
    check [this](https://stackoverflow.com/questions/32899/how-do-you-generate-dynamic-parameterized-unit-tests-in-python) – alim91 Nov 12 '20 at 10:58

0 Answers0