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

Function doctest_multiline3

IPython/testing/plugin/test_ipdoctest.py:54–76  ·  view source on GitHub ↗

Multiline examples with blank lines. In [12]: def h(x): ....: if x>1: ....: return x**2 ....: # To leave a blank line in the input, you must mark it ....: # with a comment character: ....: # ....: # otherwise the doctest pars

()

Source from the content-addressed store, hash-verified

52
53
54def doctest_multiline3():
55 """Multiline examples with blank lines.
56
57 In [12]: def h(x):
58 ....: if x>1:
59 ....: return x**2
60 ....: # To leave a blank line in the input, you must mark it
61 ....: # with a comment character:
62 ....: #
63 ....: # otherwise the doctest parser gets confused.
64 ....: else:
65 ....: return -1
66 ....:
67
68 In [13]: h(5)
69 Out[13]: 25
70
71 In [14]: h(1)
72 Out[14]: -1
73
74 In [15]: h(0)
75 Out[15]: -1
76 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected