December 2018
Intermediate to advanced
500 pages
12h 33m
English
In this chapter, we set up a testing environment. We installed pytest to make it easy to discover and execute unit tests and we created a new database to be used for testing. We wrote a first round of unit tests, measured test coverage with the pytest-cov plugin combined with the coverage tool, and then we wrote additional unit tests to improve test coverage. Finally, we understood many considerations for deployment and scalability.
We built a complex API with Flask combined with Flask-RESTful and a PostgreSQL 10.5 database that we can run as a microservice, and we tested it. Now we will move to another popular Python web framework, Django, which is the topic for the next chapter.