From 1f49977cce900e9414600ae11a25750bec8e5801 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:07:58 +0200 Subject: [PATCH 1/2] Fix typos found by codespell --- tabulate/__init__.py | 2 +- test/test_input.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tabulate/__init__.py b/tabulate/__init__.py index b7510b2..2ff8f8f 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -2647,7 +2647,7 @@ def _update_lines(self, lines, new_line): else: # A single reset code resets everything self._active_codes = [] - # Always ensure each line is color terminted if any colors are + # Always ensure each line is color terminated if any colors are # still active, otherwise colors will bleed into other cells on the console if len(self._active_codes) > 0: new_line = new_line + _ansi_color_reset_code diff --git a/test/test_input.py b/test/test_input.py index 721d03a..b910a34 100644 --- a/test/test_input.py +++ b/test/test_input.py @@ -11,7 +11,7 @@ def test_iterable_of_iterables(): - "Input: an interable of iterables." + "Input: an iterable of iterables." ii = iter(map(lambda x: iter(x), [range(5), range(5, 0, -1)])) expected = "\n".join( ["- - - - -", "0 1 2 3 4", "5 4 3 2 1", "- - - - -"] @@ -21,7 +21,7 @@ def test_iterable_of_iterables(): def test_iterable_of_iterables_headers(): - "Input: an interable of iterables with headers." + "Input: an iterable of iterables with headers." ii = iter(map(lambda x: iter(x), [range(5), range(5, 0, -1)])) expected = "\n".join( [ @@ -36,7 +36,7 @@ def test_iterable_of_iterables_headers(): def test_iterable_of_iterables_firstrow(): - "Input: an interable of iterables with the first row as headers" + "Input: an iterable of iterables with the first row as headers" ii = iter(map(lambda x: iter(x), ["abcde", range(5), range(5, 0, -1)])) expected = "\n".join( [ From ca385d2ed23a405ea18bc0fb9ce1fe5327867e8a Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:46:29 +0200 Subject: [PATCH 2/2] A round of black to pass CI tests --- test/test_internal.py | 13 +++++++++++-- test/test_output.py | 1 + test/test_regression.py | 2 +- test/test_textwrapper.py | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/test/test_internal.py b/test/test_internal.py index e7564d3..17107c6 100644 --- a/test/test_internal.py +++ b/test/test_internal.py @@ -180,7 +180,9 @@ def test_wrap_text_wide_chars(): except ImportError: skip("test_wrap_text_wide_chars is skipped") - rows = [["청자청자청자청자청자", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다"]] + rows = [ + ["청자청자청자청자청자", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다"] + ] widths = [5, 20] expected = [ [ @@ -244,7 +246,14 @@ def test_wrap_text_to_colwidths_colors_wide_char(): except ImportError: skip("test_wrap_text_to_colwidths_colors_wide_char is skipped") - data = [[("\033[31m약간 감싸면 더 잘 보일 수있는 다소 긴" " 설명입니다 설명입니다 설명입니다 설명입니다 설명\033[0m")]] + data = [ + [ + ( + "\033[31m약간 감싸면 더 잘 보일 수있는 다소 긴" + " 설명입니다 설명입니다 설명입니다 설명입니다 설명\033[0m" + ) + ] + ] result = T._wrap_text_to_colwidths(data, [30]) expected = [ diff --git a/test/test_output.py b/test/test_output.py index 059742c..68b5e55 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -1,4 +1,5 @@ """Test output of the various forms of tabular data.""" + from pytest import mark from common import assert_equal, raises, skip, check_warnings diff --git a/test/test_regression.py b/test/test_regression.py index 584ea39..bf26247 100644 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -490,7 +490,7 @@ def test_preserve_line_breaks_with_maxcolwidths(): def test_maxcolwidths_accepts_list_or_tuple(): "Regression: maxcolwidths can accept a list or a tuple (github issue #214)" - table = [["lorem ipsum dolor sit amet"]*3] + table = [["lorem ipsum dolor sit amet"] * 3] expected = "\n".join( [ "+-------------+----------+----------------------------+", diff --git a/test/test_textwrapper.py b/test/test_textwrapper.py index b315a5c..1f134fd 100644 --- a/test/test_textwrapper.py +++ b/test/test_textwrapper.py @@ -1,4 +1,5 @@ """Discretely test functionality of our custom TextWrapper""" + import datetime from tabulate import _CustomTextWrap as CTW, tabulate