@@ -47,9 +47,12 @@ def bootstrap():
4747 # assert session_list == t.sessions
4848
4949 TEST_SESSION_NAME = TEST_SESSION_PREFIX + str (randint (0 , 13370 ))
50- session = t .new_session (
51- session_name = TEST_SESSION_NAME ,
52- )
50+ try :
51+ session = t .new_session (
52+ session_name = TEST_SESSION_NAME ,
53+ )
54+ except exc .TmuxpException as e :
55+ raise e
5356
5457 '''
5558 Make sure that tmuxp can :ref:`test_builder_visually` and switches to the
@@ -58,7 +61,7 @@ def bootstrap():
5861 try :
5962 t .switch_client (session .get ('session_id' ))
6063 pass
61- except Exception :
64+ except exc . TmuxpException as e :
6265 #t.attach_session(session.get('session_id'))
6366 pass
6467
@@ -74,35 +77,17 @@ def bootstrap():
7477
7578class TmuxTestCase (unittest .TestCase ):
7679
77- '''
78- self.session
79- Session object
80- self.TEST_SESSION_NAME
81- string. name of the test case session.
82- '''
80+ """TmuxTestCase class, wraps the TestCase in a :class:`Session`."""
8381
84- @classmethod
85- def setUpClass (cls ):
86- cls .TEST_SESSION_NAME , cls .session = bootstrap ()
82+ #: :class:`Session` object.
83+ # session = None
84+ #: Session name for the TestCase.
85+ # TEST_SESSION_NAME = None
8786
8887 @classmethod
89- def setUpClassa (cls ):
88+ def setUpClass (cls ):
89+ """Add :attr:`~.TEST_SESSION_NAME` and :attr:`~.session`."""
9090 try :
91- #t.tmux('kill-server')
92-
9391 cls .TEST_SESSION_NAME , cls .session = bootstrap ()
94- # except TmuxNoClientsRunning:
95- # logger.error('test: TmuxNoClientsRunning')
96- # cls.TEST_SESSION_NAME, cls.session = bootstrap()
9792 except Exception as e :
98- import traceback
99- logger .error (e )
100-
101- logger .error (traceback .print_exc ())
102- # raise exc.TmuxpException(e)
103- return
104-
105- @classmethod
106- def tearDownClass (cls ):
107- #t.tmux('kill-server')
108- pass
93+ raise e
0 commit comments