Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1eaac2c

Browse filesBrowse files
test argspec painting
1 parent 22717d3 commit 1eaac2c
Copy full SHA for 1eaac2c

1 file changed

+16-1Lines changed: 16 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/test/test_curtsies_painting.py‎

Copy file name to clipboardExpand all lines: bpython/test/test_curtsies_painting.py
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
from curtsies.fmtfuncs import cyan, bold, green, yellow, on_magenta, red
1414
from bpython.curtsiesfrontend.events import RefreshRequestEvent
1515

16-
from bpython import config
16+
from bpython import config, inspection
1717
from bpython.curtsiesfrontend.repl import Repl
18+
from bpython.curtsiesfrontend import replpainter
1819
from bpython.repl import History
1920
from bpython.curtsiesfrontend.repl import INCONSISTENT_HISTORY_MSG, CONTIGUITY_BROKEN_MSG
2021

@@ -79,6 +80,20 @@ def test_completion(self):
7980
u'Welcome to bpython! Press <F1> f']
8081
self.assert_paint_ignoring_formatting(screen, (0, 4))
8182

83+
def test_argspec(self):
84+
def foo(x, y, z=10):
85+
"docstring!"
86+
pass
87+
argspec = inspection.getargspec('foo', foo) + [1]
88+
array = replpainter.formatted_argspec(argspec, 30, setup_config())
89+
screen = [(bold(cyan(u'foo'))+cyan(':')+cyan(' ')+cyan('(')+cyan('x') +
90+
yellow(',')+yellow(' ')+bold(cyan('y'))+yellow(',') +
91+
yellow(' ')+cyan('z')+yellow('=')+bold(cyan('10'))+yellow(')'))]
92+
print screen
93+
print array
94+
self.assertFSArraysEqual(fsarray(array), fsarray(screen))
95+
96+
8297
@contextmanager
8398
def output_to_repl(repl):
8499
old_out, old_err = sys.stdout, sys.stderr

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.