diff --git a/kitty_tests/datatypes.py b/kitty_tests/datatypes.py index 49a8adaa1..018ba7058 100644 --- a/kitty_tests/datatypes.py +++ b/kitty_tests/datatypes.py @@ -2,8 +2,10 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal -from . import BaseTest, filled_line_buf, filled_cursor, filled_history_buf +import os +from unittest import skipIf +from . import BaseTest, filled_line_buf, filled_cursor, filled_history_buf from kitty.config import build_ansi_color_table, defaults from kitty.utils import wcwidth, sanitize_title from kitty.fast_data_types import LineBuf, Cursor as C, REVERSE, ColorProfile, SpriteMap, HistoryBuf, Cursor @@ -264,6 +266,7 @@ class TestDataTypes(BaseTest): lb2 = self.line_comparison_rewrap(lb, '123', 'abc', 'de ') self.assertContinued(lb2, False, False, True) + @skipIf('ANCIENT_WCWIDTH' in os.environ, 'wcwidth() is too old') def test_utils(self): self.ae(tuple(map(wcwidth, 'a1\0コニチ ')), (1, 1, 0, 2, 2, 2, 1)) self.assertEqual(sanitize_title('a\0\01 \t\n\f\rb'), 'a b') diff --git a/kitty_tests/parser.py b/kitty_tests/parser.py index dd7b7e8c6..a4c208e01 100644 --- a/kitty_tests/parser.py +++ b/kitty_tests/parser.py @@ -2,10 +2,11 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +import os from functools import partial +from unittest import skipIf from . import BaseTest - from kitty.fast_data_types import parse_bytes, parse_bytes_dump, CURSOR_BLOCK @@ -38,6 +39,7 @@ class TestParser(BaseTest): q.append(('draw', current)) self.ae(tuple(q), cmds) + @skipIf('ANCIENT_WCWIDTH' in os.environ, 'wcwidth() is too old') def test_simple_parsing(self): s = self.create_screen() pb = partial(self.parse_bytes_dump, s) diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index afa22d447..fb5c2ee7b 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -2,8 +2,10 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal -from . import BaseTest +import os +from unittest import skipIf +from . import BaseTest from kitty.fast_data_types import DECAWM, IRM, Cursor, DECCOLM, DECOM @@ -53,6 +55,7 @@ class TestScreen(BaseTest): self.ae((s.cursor.x, s.cursor.y), (2, 4)) self.assertChanges(s, ignore='cursor', cells={4: ((0, 4),)}) + @skipIf('ANCIENT_WCWIDTH' in os.environ, 'wcwidth() is too old') def test_draw_char(self): # Test in line-wrap, non-insert mode s = self.create_screen() @@ -102,6 +105,7 @@ class TestScreen(BaseTest): self.ae((s.cursor.x, s.cursor.y), (2, 4)) self.assertChanges(s, ignore='cursor', cells={4: ((0, 4),)}) + @skipIf('ANCIENT_WCWIDTH' in os.environ, 'wcwidth() is too old') def test_char_manipulation(self): s = self.create_screen()