diff options
author | Jeff Quast <jquast@io.com> | 2015-01-03 22:09:12 -0800 |
---|---|---|
committer | Jeff Quast <jquast@io.com> | 2015-01-03 22:09:12 -0800 |
commit | 58a381ccf551c4d5d796b17e1271f604e98b0234 (patch) | |
tree | 4bf2f8df733005b9fc77dca99294b2ad809c7c2e | |
parent | 1ee8b786cf0711f7d288ae13b5d74371aeac33ef (diff) | |
download | blessings-58a381ccf551c4d5d796b17e1271f604e98b0234.tar.gz |
chose only 3 random-available terminal types for testing
-rw-r--r-- | blessed/tests/accessories.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/blessed/tests/accessories.py b/blessed/tests/accessories.py index 46a3972..9c06688 100644 --- a/blessed/tests/accessories.py +++ b/blessed/tests/accessories.py @@ -7,6 +7,7 @@ import subprocess import functools import traceback import termios +import random import codecs import curses import sys @@ -33,12 +34,18 @@ many_columns_params = [1, 25, 50] from blessed._binterms import binary_terminals default_all_terms = ['screen', 'vt220', 'rxvt', 'cons25', 'linux', 'ansi'] try: - all_terms_params = list(set( + available_terms = [ _term.split(None, 1)[0].decode('ascii') for _term in subprocess.Popen(["toe"], stdout=subprocess.PIPE, close_fds=True) - .communicate()[0].splitlines() - ) - (set(binary_terminals) if not os.environ.get('TEST_BINTERMS') - else set())) or default_all_terms + .communicate()[0].splitlines()] + if not os.environ.get('TEST_ALLTERMS'): + # we just pick 3 random terminal types, they're all as good as any so + # long as they're not in the binary_terminals list. + random.shuffle(available_terms) + available_terms = available_terms[:3] + all_terms_params = list(set(available_terms) - ( + set(binary_terminals) if not os.environ.get('TEST_BINTERMS') + else set())) or default_all_terms except OSError: all_terms_params = default_all_terms |