Skip to content

testing

#263: Generate Realistic Test Data With Faker

If you have ever worked on a project that needed realistic test data, you know how tedious it can be to create it manually. Hardcoding names, addresses, or even phone numbers into your test suite not only clutters your code but also makes it inflexible. Thankfully, the Python Faker library comes to the rescue.

#239: Asynchronous Tests With Pytest

After finishing the dashboard, I hoped to quickly switch my datastore implementation to use the asynchronous methods for SQLAlchemy. Unfortunately, that was not the case. Everything needs to change, and that change must be done all at once. That includes pytest, that we need to run our tests.

To make the change more understandable, we start in this post with pytest and do the necessary work to test asynchronous methods. With that out of our way, we can next week focus on SQLAlchemy.

#216: Test Your FastAPI Application

If we do not want to keep starting our API and manually click through the endpoints to see if everything still works, we need to put a little effort into testing. Thanks to the underlying Starlette toolkit, we can test our FastAPI application in-memory and do not need a dedicated server. Let us explore how that helps us with testing our API.

#68: Use Doctest to Test Your Documentation

Documentation is an important part of every software project – and probably the most neglected one. Nothing is worse than outdated documentation with examples that no longer work. Python has a great little helper to ensure that your documentation is up to date.