Running the unit test

Now that we have all the test suites, rather than run them in your IDE, such as PyCharm, you can run the tests from the root folder using the following bash command:

$ python3 -m unittest discover test 

unittest automatically detects that all of the test files must be modules or packages importable from the top-level directory of the project. Here, we just want to run the tests from the test folder that begin with the test_ prefix. 

I have created a shell script under serverless-microservice-data-api/bash/apigateway-lambda-dynamodb/

#!/bin/sh (cd ../..; python3 -m unittest discover test) 

Get Building Serverless Microservices in Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.