This repo contains an exmaple of a unit tests in python. In this repo, I show how to run the unit tests, it achieving 100% test coverage by the full path of each methods Click here to see the paths and Control Flow Graphs
- install the dependanceies:
pip3 install -r requirements.txt
pytest test_calculatorApp.py
- To display the code coverage page, open the htmlcov folder then open the index.html file on your browser.
- To create a more concise html version of the report, Run:
coverage html
-
pytest --cov=calculatorApp
- To display the report page, open the htmlcov folder then open the calculatorApp_py.html file on your browser.
-
pytest --cov=calculatorApp --cov-report=html