Consider the following doc containing doctests.
def f(x):
"""
Increments by one.
>>> f(2)
3
"""
return x + 1
PyCharm's test runner (as seen here) picks the doctest up.
But the following is not seen by PyCharm as a doctest (though it is seen by pytest --doctest-modules -v
for example).
f = lambda x: x + 1
f.__doc__ = """
Increments by one.
>>> f(2)
3
"""