From 19a0e9def85b6a8f066594ae25204338c28eeb04 Mon Sep 17 00:00:00 2001 From: Thomas Roten Date: Sat, 25 May 2019 15:23:32 -0500 Subject: [PATCH] Fix use of bold in Pygments tests. --- tests/tabular_output/test_preprocessors.py | 6 +-- tests/tabular_output/test_tabulate_adapter.py | 42 +++++++++---------- .../test_terminaltables_adapter.py | 42 +++++++++---------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py index d79b744..44fc652 100644 --- a/tests/tabular_output/test_preprocessors.py +++ b/tests/tabular_output/test_preprocessors.py @@ -161,7 +161,7 @@ class CliStyle(Style): headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [['\x1b[38;5;233;48;5;7m观音\x1b[39;49m', '\x1b[38;5;233;48;5;7m2\x1b[39;49m'], ['\x1b[38;5;10mΠοσειδῶν\x1b[39m', '\x1b[38;5;10mb\x1b[39m']] @@ -183,7 +183,7 @@ class CliStyle(Style): headers = ['h1', 'h2'] data = [['观音\nLine2', 'Ποσειδῶν']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [ ['\x1b[38;5;233;48;5;7m观音\x1b[39;49m\n\x1b[38;5;233;48;5;7m' 'Line2\x1b[39;49m', @@ -207,7 +207,7 @@ class CliStyle(Style): headers = ['h1', 'h2'] data = [['1', '2'], ['a', 'b']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [['\x1b[38;5;233;48;5;7m1\x1b[39;49m', '\x1b[38;5;233;48;5;7m2\x1b[39;49m'], ['\x1b[38;5;10ma\x1b[39m', '\x1b[38;5;10mb\x1b[39m']] diff --git a/tests/tabular_output/test_tabulate_adapter.py b/tests/tabular_output/test_tabulate_adapter.py index d2ade12..e0dd5a8 100644 --- a/tests/tabular_output/test_tabulate_adapter.py +++ b/tests/tabular_output/test_tabulate_adapter.py @@ -73,24 +73,24 @@ class CliStyle(Style): output = tabulate_adapter.adapter(iter(data), headers, table_format='psql') assert "\n".join(output) == dedent('''\ - \x1b[31;01m+\x1b[39;00m''' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' + - ''' h2 \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m|\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '''\x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' + - ''' 2 \x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' + - ''' b \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '\x1b[31;01m+\x1b[39;00m') + \x1b[91m+\x1b[39m''' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' + + ''' h2 \x1b[91m|\x1b[39m + ''' + '\x1b[91m|\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '''\x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' + + ''' 2 \x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' + + ''' b \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '\x1b[91m+\x1b[39m') diff --git a/tests/tabular_output/test_terminaltables_adapter.py b/tests/tabular_output/test_terminaltables_adapter.py index 8794129..f756327 100644 --- a/tests/tabular_output/test_terminaltables_adapter.py +++ b/tests/tabular_output/test_terminaltables_adapter.py @@ -46,24 +46,24 @@ class CliStyle(Style): output = terminaltables_adapter.adapter(iter(data), headers, table_format='ascii') assert "\n".join(output) == dedent('''\ - \x1b[31;01m+\x1b[39;00m''' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' + - ''' h2 \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' + - ''' 2 \x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' + - ''' b \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '\x1b[31;01m+\x1b[39;00m') + \x1b[91m+\x1b[39m''' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' + + ''' h2 \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' + + ''' 2 \x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' + + ''' b \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '\x1b[91m+\x1b[39m') From ccc7aaffca8fa6e2b2f167a9d0f13e4dafe75aee Mon Sep 17 00:00:00 2001 From: Thomas Roten Date: Fri, 24 May 2019 12:36:41 -0500 Subject: [PATCH] Pin to Pygments >= 2.4.0 for tests. --- cli_helpers/tabular_output/preprocessors.py | 2 +- tests/tabular_output/test_preprocessors.py | 6 +++--- tests/tabular_output/test_tabulate_adapter.py | 2 +- tests/tabular_output/test_terminaltables_adapter.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cli_helpers/tabular_output/preprocessors.py b/cli_helpers/tabular_output/preprocessors.py index 9bbbd39..8a1c91f 100644 --- a/cli_helpers/tabular_output/preprocessors.py +++ b/cli_helpers/tabular_output/preprocessors.py @@ -193,7 +193,7 @@ def style_output(data, headers, style=None, class YourStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py index 4eb9165..d79b744 100644 --- a/tests/tabular_output/test_preprocessors.py +++ b/tests/tabular_output/test_preprocessors.py @@ -154,7 +154,7 @@ def test_style_output(): class CliStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } @@ -176,7 +176,7 @@ def test_style_output_with_newlines(): class CliStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } @@ -200,7 +200,7 @@ def test_style_output_custom_tokens(): class CliStyle(Style): default_style = "" styles = { - Token.Results.Headers: 'bold #ansired', + Token.Results.Headers: 'bold ansibrightred', Token.Results.OddRows: 'bg:#eee #111', Token.Results.EvenRows: '#0f0' } diff --git a/tests/tabular_output/test_tabulate_adapter.py b/tests/tabular_output/test_tabulate_adapter.py index c289cba..d2ade12 100644 --- a/tests/tabular_output/test_tabulate_adapter.py +++ b/tests/tabular_output/test_tabulate_adapter.py @@ -63,7 +63,7 @@ def test_style_output_table(): class CliStyle(Style): default_style = "" styles = { - Token.Output.TableSeparator: '#ansired', + Token.Output.TableSeparator: 'ansibrightred', } headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']] diff --git a/tests/tabular_output/test_terminaltables_adapter.py b/tests/tabular_output/test_terminaltables_adapter.py index fc49b99..8794129 100644 --- a/tests/tabular_output/test_terminaltables_adapter.py +++ b/tests/tabular_output/test_terminaltables_adapter.py @@ -36,7 +36,7 @@ def test_style_output_table(): class CliStyle(Style): default_style = "" styles = { - Token.Output.TableSeparator: '#ansired', + Token.Output.TableSeparator: 'ansibrightred', } headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']]