How to Make Doctests Easy in Python with Gitpod and VS Code
· 4 min read
If you're writing doctests in Python using Gitpod or VS Code, you don’t need much to get started. Python’s built-in doctest
module lets you write examples in your function’s docstring using the familiar >>>
prompt, and then run those examples as tests. This is great for small, focused functions or when you want your documentation to double as lightweight tests.