Microservices Classroomnotes 16/Feb/2022

Unit Testing of flask api using pytest

  • First lets try to make our application i.e. Catalog API testable
  • For this we will be using existing environmental variable FLASK_ENV Refer Here
  • Install pytest pip install pytest and pip freeze > requirements.txt
  • To test the flask application with pytest or any other unit tests Refer Here
  • Refer Here for the changes made to create a first test which calls the api resource to create a new catalog type and verifies the response and count of catalog types before and after making post call.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner