Browsed by
Tag: test-drive development

Testing a Flask REST API using Factory Boy and an in-memory sqlite database

Testing a Flask REST API using Factory Boy and an in-memory sqlite database

I’m developing a REST API using Python’s Flask microframework. As I wanted to do test driven development to ensure good test coverage, I needed a working testing framework. After checking out a few different options, I found one that works well for my use case. I thought I’d share my setup in case it may be of help to others. First, this is how I create the server: