From cac99271ca1c88fdb54cf43024b67c78ab20efad Mon Sep 17 00:00:00 2001 From: Foo Date: Sun, 30 Apr 2017 14:42:54 +0300 Subject: [PATCH] Move lib variable to do_terminal_tests --- tests/lib/terminal.py | 9 ++++++++- tests/test_in_vterm/test_tmux.py | 6 ------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/lib/terminal.py b/tests/lib/terminal.py index 8088a0cf..7b3434a6 100644 --- a/tests/lib/terminal.py +++ b/tests/lib/terminal.py @@ -219,8 +219,15 @@ def get_env(vterm_path, test_dir, *args, **kwargs): return env -def do_terminal_tests(tests, cmd, lib, dim, args, env, cwd=None, fin_cb=None, +def do_terminal_tests(tests, cmd, dim, args, env, cwd=None, fin_cb=None, last_attempt_cb=None, attempts=3): + lib = os.environ.get('POWERLINE_LIBVTERM') + if not lib: + if os.path.exists('tests/bot-ci/deps/libvterm/libvterm.so'): + lib = 'tests/bot-ci/deps/libvterm/libvterm.so' + else: + lib = 'libvterm.so' + while attempts: try: p = ExpectProcess( diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index de8a87d6..8bb98fd3 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -69,11 +69,6 @@ def main(attempts=3): tmux_exe = os.path.join(vterm_path, 'tmux') - if os.path.exists('tests/bot-ci/deps/libvterm/libvterm.so'): - lib = 'tests/bot-ci/deps/libvterm/libvterm.so' - else: - lib = os.environ.get('POWERLINE_LIBVTERM', 'libvterm.so') - socket_path = os.path.abspath('tmux-socket-{0}'.format(attempts)) if os.path.exists(socket_path): os.unlink(socket_path) @@ -237,7 +232,6 @@ def main(attempts=3): return do_terminal_tests( tests=tests, cmd=tmux_exe, - lib=lib, dim=dim, args=args, env=env,