22
22
readline = import_module ("
8000
readline" )
23
23
24
24
from _pyrepl .console import Console , Event
25
- from _pyrepl .readline import ReadlineAlikeReader , ReadlineConfig , _ReadlineWrapper
25
+ from _pyrepl .readline import ReadlineAlikeReader , ReadlineConfig
26
26
from _pyrepl .simple_interact import _strip_final_indent
27
27
from _pyrepl .unix_eventqueue import EventQueue
28
28
from _pyrepl .input import KeymapTranslator
@@ -279,7 +279,7 @@ def test_cursor_position_double_width_characters_move_up(self):
279
279
280
280
# fmt: off
281
281
code = (
282
- f"{ for_loop } \n "
282
+ f"{ for_loop } \n "
283
283
" ' 可口可乐; 可口可樂'"
284
284
)
285
285
# fmt: on
@@ -302,7 +302,7 @@ def test_cursor_position_double_width_characters_move_up_down(self):
302
302
303
303
# fmt: off
304
304
code = (
305
- f"{ for_loop } \n "
305
+ f"{ for_loop } \n "
306
306
" ' 可口可乐; 可口可樂'"
307
307
)
308
308
# fmt: on
@@ -349,8 +349,8 @@ def test_cursor_position_move_up_to_eol(self):
349
349
code = (
350
350
f"{ first_line } \n "
351
351
f"{ second_line } \n "
352
- " h\n "
353
- " hel"
352
+ " h\n "
353
+ " hel"
354
354
)
355
355
# fmt: on
356
356
@@ -382,7 +382,7 @@ def test_cursor_position_move_down_to_eol(self):
382
382
"for _ in _:\n "
383
383
" hello\n "
384
384
" h\n "
385
- f"{ last_line } "
385
+ f"{ last_line } "
386
386
)
387
387
# fmt: on
388
388
@@ -655,6 +655,7 @@ def test_func(self):
655
655
self .assertEqual (output [0 ], "dummy.test_func." )
656
656
self .assertEqual (f .getvalue (), "" )
657
657
658
+
658
659
@patch ("_pyrepl.curses.tigetstr" , lambda x : b"" )
659
660
class TestUnivEventQueue (TestCase ):
660
661
def setUp (self ):
@@ -930,24 +931,24 @@ def assert_screen_equals(self, reader, expected):
930
931
def test_calc_screen_wrap_simple (self ):
931
932
events = code_to_events (10 * "a" )
932
933
reader , _ = handle_events_narrow_console (events )
933
- self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n a" )
934
+ self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n a" )
934
935
935
936
def test_calc_screen_wrap_wide_characters (self ):
936
937
events = code_to_events (8 * "a" + "樂" )
937
938
reader , _ = handle_events_narrow_console (events )
938
- self .assert_screen_equals (reader , f"{ 8 * "a" } \\ \n 樂" )
939
+ self .assert_screen_equals (reader , f"{ 8 * "a" } \\ \n 樂" )
939
940
940
941
def test_calc_screen_wrap_three_lines (self ):
941
942
events = code_to_events (20 * "a" )
942
943
reader , _ = handle_events_narrow_console (events )
943
- self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n { 9 * "a" } \\ \n aa" )
944
+ self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n { 9 * "a" } \\ \n aa" )
944
945
945
946
def test_calc_screen_wrap_three_lines_mixed_character (self ):
946
947
# fmt: off
947
948
code = (
948
949
"def f():\n "
949
- f" { 8 * "a" } \n "
950
- f" { 5 * "樂" } "
950
+ f" { 8 * "a" } \n "
951
+ f" { 5 * "樂" } "
951
952
)
952
953
# fmt: on
953
954
@@ -957,9 +958,9 @@ def test_calc_screen_wrap_three_lines_mixed_character(self):
957
958
# fmt: off
958
959
self .assert_screen_equals (reader , (
959
960
"def f():\n "
960
- f" { 7 * "a" } \\ \n "
961
+ f" { 7 * "a" } \\ \n "
961
962
"a\n "
962
- f" { 3 * "樂" } \\ \n "
963
+ f" { 3 * "樂" } \\ \n "
963
964
"樂樂"
964
965
))
965
966
# fmt: on
@@ -992,7 +993,7 @@ def test_calc_screen_backspace_in_second_line_after_wrap(self):
992
993
],
993
994
)
994
995
reader , _ = handle_events_narrow_console (events )
995
- self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n a" )
996
+ self .assert_screen_equals (reader , f"{ 9 * "a" } \\ \n a" )
996
997
997
998
def test_setpos_for_xy_simple (self ):
998
999
events = code_to_events ("11+11" )
0 commit comments