44import sys
55
66from contextlib import contextmanager
7- from curtsies .formatstringarray import FormatStringTest , fsarray
7+ from curtsies .formatstringarray import (
8+ fsarray ,
9+ assertFSArraysEqual ,
10+ assertFSArraysEqualIgnoringFormatting ,
11+ )
812from curtsies .fmtfuncs import cyan , bold , green , yellow , on_magenta , red
913from unittest import mock
1014
@@ -41,7 +45,7 @@ def tearDownClass(cls):
4145 TestCase .tearDownClass ()
4246
4347
44- class CurtsiesPaintingTest (FormatStringTest , ClearEnviron ):
48+ class CurtsiesPaintingTest (ClearEnviron ):
4549 def setUp (self ):
4650 class TestRepl (BaseRepl ):
4751 def _request_refresh (inner_self ):
@@ -56,14 +60,14 @@ def locals(self):
5660
5761 def assert_paint (self , screen , cursor_row_col ):
5862 array , cursor_pos = self .repl .paint ()
59- self . assertFSArraysEqual (array , screen )
63+ assertFSArraysEqual (array , screen )
6064 self .assertEqual (cursor_pos , cursor_row_col )
6165
6266 def assert_paint_ignoring_formatting (
6367 self , screen , cursor_row_col = None , ** paint_kwargs
6468 ):
6569 array , cursor_pos = self .repl .paint (** paint_kwargs )
66- self . assertFSArraysEqualIgnoringFormatting (array , screen )
70+ assertFSArraysEqualIgnoringFormatting (array , screen )
6771 if cursor_row_col is not None :
6872 self .assertEqual (cursor_pos , cursor_row_col )
6973
@@ -156,7 +160,7 @@ def foo(x, y, z=10):
156160 + bold (cyan ("10" ))
157161 + yellow (")" )
158162 ]
159- self . assertFSArraysEqual (fsarray (array ), fsarray (screen ))
163+ assertFSArraysEqual (fsarray (array ), fsarray (screen ))
160164
161165 def test_formatted_docstring (self ):
162166 actual = replpainter .formatted_docstring (
@@ -165,7 +169,7 @@ def test_formatted_docstring(self):
165169 config = setup_config (),
166170 )
167171 expected = fsarray (["Returns the results" , "" , "Also has side effects" ])
168- self . assertFSArraysEqualIgnoringFormatting (actual , expected )
172+ assertFSArraysEqualIgnoringFormatting (actual , expected )
169173
170174 def test_unicode_docstrings (self ):
171175 "A bit of a special case in Python 2"
@@ -178,7 +182,7 @@ def foo():
178182 foo .__doc__ , 40 , config = setup_config ()
179183 )
180184 expected = fsarray (["åß∂ƒ" ])
181- self . assertFSArraysEqualIgnoringFormatting (actual , expected )
185+ assertFSArraysEqualIgnoringFormatting (actual , expected )
182186
183187 def test_nonsense_docstrings (self ):
184188 for docstring in [
@@ -208,7 +212,7 @@ def foo():
208212 wd = pydoc .getdoc (foo )
209213 actual = replpainter .formatted_docstring (wd , 40 , config = setup_config ())
210214 expected = fsarray (["asdfåß∂ƒ" ])
211- self . assertFSArraysEqualIgnoringFormatting (actual , expected )
215+ assertFSArraysEqualIgnoringFormatting (actual , expected )
212216
213217 def test_paint_lasts_events (self ):
214218 actual = replpainter .paint_last_events (
@@ -219,7 +223,7 @@ def test_paint_lasts_events(self):
219223 else :
220224 expected = fsarray (["+-+" , "|c|" , "|b|" , "+-+" ])
221225
222- self . assertFSArraysEqualIgnoringFormatting (actual , expected )
226+ assertFSArraysEqualIgnoringFormatting (actual , expected )
223227
224228
225229@contextmanager
0 commit comments