Python unit tests run function after all test
问题 I need to test smth on python via ssh. I don't want to make ssh connection for every test, because it is to long, I have written this: class TestCase(unittest.TestCase): client = None def setUp(self): if not hasattr(self.__class__, 'client') or self.__class__.client is None: self.__class__.client = paramiko.SSHClient() self.__class__.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.__class__.client.connect(hostname=consts.get_host(), port=consts.get_port(), username=consts