Skip to content

Commit

Permalink
Check performance of testsuite if using setUpClass to begin.
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Mar 29, 2014
1 parent 5327b75 commit 2ab9e23
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tmuxp/testsuite/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 2ab9e23

Please sign in to comment.