Skip to content

Commit 80d7d94

Browse files
committed
Use new assert helper functions from curtsies
1 parent b522be4 commit 80d7d94

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ your config file as **~/.config/bpython/config** (i.e.
155155
Dependencies
156156
============
157157
* Pygments
158-
* curtsies >= 0.3.3
158+
* curtsies >= 0.3.5
159159
* greenlet
160160
* pyxdg
161161
* requests

bpython/test/test_curtsies_painting.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import sys
55

66
from contextlib import contextmanager
7-
from curtsies.formatstringarray import FormatStringTest, fsarray
7+
from curtsies.formatstringarray import (
8+
fsarray,
9+
assertFSArraysEqual,
10+
assertFSArraysEqualIgnoringFormatting,
11+
)
812
from curtsies.fmtfuncs import cyan, bold, green, yellow, on_magenta, red
913
from 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

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Pygments
2-
curtsies >=0.3.3
2+
curtsies >=0.3.5
33
cwcwidth
44
greenlet
55
pyxdg

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def git_describe_to_python_version(version):
177177
install_requires = [
178178
"pygments",
179179
"requests",
180-
"curtsies >=0.3.3",
180+
"curtsies >=0.3.5",
181181
"greenlet",
182182
"cwcwidth",
183183
"pyxdg",

0 commit comments

Comments
 (0)