Skip to main content

3 posts tagged with "pytest"

pytest tag description

View All Tags

How to Make Doctests Easy in Python with Gitpod and VS Code

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

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.

Testing in Python for Beginners. Using `unittest` and `pytest` with Fun Examples

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Writing tests in Python helps ensure that your code works correctly. In this guide, we'll use two popular testing tools: the built-in unittest module and the third-party library pytest. We'll walk through both using examples related to vegetables and AI model names.