sasoptpy uses Python Unit Tests to ensure each commit brings a non-breaking change.
Unit tests are classified based on which component it is related to. Our main aim is to add unit tests along with every code change to increase or keep the code coverage the same.
All unit tests can be run using
python -m unittest discover -s tests/ -p 'test*.py'
This would run all the python files under /tests
folder starting with test
.
Code coverage is tested using coverage
package. Use test_coverage.sh
file to run the script.
Running test_coverage.sh
generates html
folder, which can be displayed using a browser.
Each individual test file aims to provide highest level of code coverage.
If you need to run a single test to check code coverage, run test_single.sh
script with following arguments:
./test_single.sh {path_to_specific_test.py}
This will update the code coverage folder under html
.