本文整理汇总了Python中accessories.TestTerminal.bold_misspelled方法的典型用法代码示例。如果您正苦于以下问题:Python TestTerminal.bold_misspelled方法的具体用法?Python TestTerminal.bold_misspelled怎么用?Python TestTerminal.bold_misspelled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类accessories.TestTerminal
的用法示例。
在下文中一共展示了TestTerminal.bold_misspelled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: child
# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import bold_misspelled [as 别名]
def child(kind):
t = TestTerminal(kind=kind)
try:
t.bold_misspelled('hey')
assert not t.is_a_tty or False, 'Should have thrown exception'
except TypeError:
e = sys.exc_info()[1]
assert 'probably misspelled' in e.args[0]
try:
t.bold_misspelled(u'hey') # unicode
assert not t.is_a_tty or False, 'Should have thrown exception'
except TypeError:
e = sys.exc_info()[1]
assert 'probably misspelled' in e.args[0]
try:
t.bold_misspelled(None) # an arbitrary non-string
assert not t.is_a_tty or False, 'Should have thrown exception'
except TypeError:
e = sys.exc_info()[1]
assert 'probably misspelled' not in e.args[0]
if platform.python_implementation() != 'PyPy':
# PyPy fails to toss an exception, Why?!
try:
t.bold_misspelled('a', 'b') # >1 string arg
assert not t.is_a_tty or False, 'Should have thrown exception'
except TypeError:
e = sys.exc_info()[1]
assert 'probably misspelled' in e.args[0], e.args