Description
pytest is Python's most popular test framework. It makes testing simple and fun, and its rich plugin ecosystem enables you to do just about anything! However, writing good tests is still challenging. There is testing theory that goes along with testing practice.
In this tutorial, let's learn how to start testing in Python with pytest. Specifically, we will cover:
- Configuring projects for testing
- Writing and running test functions with pytest's basic mechanics
- Parameterizing tests
- Handling setup and cleanup with fixtures
- A little bit of mocking to go a long way
- Testing web APIs and UIs with Playwright
Bring your laptops, because we will be doing hands-on code the whole tutorial! By the end of this tutorial, you'll be able to test your Python code like a champion.