File tree Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 99 with_statement , unicode_literals
1010
1111import logging
12- import unittest
1312import sys
1413
1514from .. import log
1615from .._compat import string_types , PY2 , reraise
1716from ..server import Server
1817
18+ try :
19+ import unittest2 as unittest
20+ except ImportError : # Python 2.7
21+ import unittest
22+
1923import pkgutil
2024
2125logger = logging .getLogger ()
@@ -91,7 +95,7 @@ def import_string(import_name, silent=False):
9195 `None` is returned instead.
9296 :return: imported object
9397 """
94- #XXX: py3 review needed
98+ # XXX: py3 review needed
9599 assert isinstance (import_name , string_types )
96100 # force the import name to automatically convert to strings
97101 import_name = str (import_name )
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ class TestCase(unittest.TestCase):
2929
3030 """Base TestClass so we don't have to try: unittest2 every module. """
3131
32+ @classmethod
33+ def setUpClass (cls ):
34+ super (TestCase , cls ).setUpClass () # for python 2.6 unittest2
35+
3236
3337class TmuxTestCase (TestCase ):
3438
@@ -41,6 +45,7 @@ class TmuxTestCase(TestCase):
4145
4246 def setUp (self ):
4347 """Run bootstrap if :attr:`~.session` is not set."""
48+
4449 if not self .TEST_SESSION_NAME or not self .session :
4550 self .bootstrap ()
4651
@@ -95,7 +100,7 @@ def bootstrap(self):
95100 t .switch_client (session .get ('session_id' ))
96101 pass
97102 except exc .TmuxpException as e :
98- #t.attach_session(session.get('session_id'))
103+ # t.attach_session(session.get('session_id'))
99104 pass
100105
101106 for old_test_session in old_test_sessions :
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ def test_automatic_rename_option(self):
303303 self .session .server ._update_windows ()
304304 if w .get ('window_name' ) != 'man' :
305305 break
306- time .sleep (.2 )
306+ time .sleep (.1 )
307307
308308 self .assertNotEqual (w .get ('window_name' ), 'man' )
309309
@@ -314,7 +314,7 @@ def test_automatic_rename_option(self):
314314 self .session .server ._update_windows ()
315315 if w .get ('window_name' ) == 'man' :
316316 break
317- time .sleep (.25 )
317+ time .sleep (.1 )
318318
319319 self .assertEqual (w .get ('window_name' ), text_type ('man' ))
320320
@@ -323,7 +323,7 @@ def test_automatic_rename_option(self):
323323 self .session .server ._update_windows ()
324324 if w ['window_name' ] != 'man' :
325325 break
326- time .sleep (.25 )
326+ time .sleep (.1 )
327327
328328 self .assertNotEqual (w .get ('window_name' ), text_type ('man' ))
329329
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class FreezeTest(TmuxTestCase):
4949 - window_name: test
5050 panes:
5151 - shell_command:
52- - htop
52+ - top
5353 """
5454
5555 def test_focus (self ):
@@ -64,8 +64,7 @@ def test_freeze_config(self):
6464 builder .build (session = self .session )
6565 assert (self .session == builder .session )
6666
67- import time
68- time .sleep (1 )
67+ time .sleep (.50 )
6968
7069 session = self .session
7170 sconf = freeze (session )
You can’t perform that action at this time.
0 commit comments