doctest

Testing through documentation

Interview Relevant: Documentation testing

Doctest

Run tests embedded in docstrings.

Code Examples

python
1def add(a, b):
2    """
3    >>> add(1, 2)
4    3
5    """
6    return a + b

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In