diff --git a/tmuxp/testsuite/helpers.py b/tmuxp/testsuite/helpers.py index b9c02544b3c..0b588bb981e 100644 --- a/tmuxp/testsuite/helpers.py +++ b/tmuxp/testsuite/helpers.py @@ -39,12 +39,14 @@ class TmuxTestCase(TestCase): #: Session name for the TestCase. TEST_SESSION_NAME = None - def setUp(self): + @classmethod + def setUpClass(cls): """Run bootstrap if :attr:`~.session` is not set.""" - if not self.TEST_SESSION_NAME or not self.session: - self.bootstrap() + if not cls.TEST_SESSION_NAME or not cls.session: + cls.bootstrap() - def bootstrap(self): + @classmethod + def bootstrap(cls): """Return tuple of the session_name (generated) and :class:`Session`. Checks to verify if the user has a tmux client open. @@ -95,7 +97,7 @@ def bootstrap(self): t.switch_client(session.get('session_id')) pass except exc.TmuxpException as e: - #t.attach_session(session.get('session_id')) + # t.attach_session(session.get('session_id')) pass for old_test_session in old_test_sessions: @@ -107,5 +109,5 @@ def bootstrap(self): assert TEST_SESSION_NAME == session.get('session_name') assert TEST_SESSION_NAME != 'tmuxp' - self.TEST_SESSION_NAME = TEST_SESSION_NAME - self.session = session + cls.TEST_SESSION_NAME = TEST_SESSION_NAME + cls.session = session