diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-28 14:46:28 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-28 14:46:28 +0300 |
commit | 86568a9d1590ec529af95a7e16fb889b09162ed9 (patch) | |
tree | dbad39b76dcca72fd5551a0f782f6ad2a2bcd199 /contrib/python/prompt-toolkit/py3/tests | |
parent | e6eedf7496d3741c2226a52ac25b12851b331112 (diff) | |
download | ydb-86568a9d1590ec529af95a7e16fb889b09162ed9.tar.gz |
intermediate changes
ref:8cc96053e249b790770c75de97ccbea86351cff2
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/tests')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py b/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py index 0e8bdd80d3..6a344a732d 100644 --- a/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py +++ b/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py @@ -12,7 +12,6 @@ from prompt_toolkit.utils import is_windows class _Capture: "Emulate an stdout object." - encoding = "utf-8" def __init__(self): self._data = [] @@ -22,7 +21,7 @@ class _Capture: @property def data(self): - return b"".join(self._data) + return "".join(self._data) def flush(self): pass @@ -40,15 +39,15 @@ class _Capture: def test_print_formatted_text(): f = _Capture() pt_print([("", "hello"), ("", "world")], file=f) - assert b"hello" in f.data - assert b"world" in f.data + assert "hello" in f.data + assert "world" in f.data @pytest.mark.skipif(is_windows(), reason="Doesn't run on Windows yet.") def test_print_formatted_text_backslash_r(): f = _Capture() pt_print("hello\r\n", file=f) - assert b"hello" in f.data + assert "hello" in f.data @pytest.mark.skipif(is_windows(), reason="Doesn't run on Windows yet.") @@ -70,8 +69,8 @@ def test_formatted_text_with_style(): # NOTE: We pass the default (8bit) color depth, so that the unit tests # don't start failing when environment variables change. pt_print(tokens, style=style, file=f, color_depth=ColorDepth.DEFAULT) - assert b"\x1b[0;38;5;197mHello" in f.data - assert b"\x1b[0;38;5;83;3mworld" in f.data + assert "\x1b[0;38;5;197mHello" in f.data + assert "\x1b[0;38;5;83;3mworld" in f.data @pytest.mark.skipif(is_windows(), reason="Doesn't run on Windows yet.") @@ -87,5 +86,5 @@ def test_html_with_style(): assert ( f.data - == b"\x1b[0m\x1b[?7h\x1b[0;32mhello\x1b[0m \x1b[0;1mworld\x1b[0m\r\n\x1b[0m" + == "\x1b[0m\x1b[?7h\x1b[0;32mhello\x1b[0m \x1b[0;1mworld\x1b[0m\r\n\x1b[0m" ) |