MCPcopy Create free account
hub / github.com/ipython/ipython / test_function_pretty

Function test_function_pretty

IPython/lib/tests/test_pretty.py:438–451  ·  view source on GitHub ↗

Test pretty print of function

()

Source from the content-addressed store, hash-verified

436
437
438def test_function_pretty():
439 "Test pretty print of function"
440 # posixpath is a pure python module, its interface is consistent
441 # across Python distributions
442 import posixpath
443 nt.assert_equal(pretty.pretty(posixpath.join), '<function posixpath.join(a, *p)>')
444
445 # custom function
446 def meaning_of_life(question=None):
447 if question:
448 return 42
449 return "Don't panic"
450
451 nt.assert_in('meaning_of_life(question=None)', pretty.pretty(meaning_of_life))
452
453
454class OrderedCounter(Counter, OrderedDict):

Callers

nothing calls this directly

Calls 1

prettyMethod · 0.80

Tested by

no test coverage detected