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
andpip 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.