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 + bTesting through documentation
Run tests embedded in docstrings.
1def add(a, b):
2 """
3 >>> add(1, 2)
4 3
5 """
6 return a + bAsk about the topic