Unit Testing
- Goal of unit testing is to identify as many defects as possible in early stages
- Unit Testing: We test a unit of code with all possibilities
- Unit Tests are supposed to be executed after every change by any member of the team to the code.
Unit Testing Frameworks
Lets build a application which is library application
- Create a new folder
- activate virtual environment
- Install pytest packages
pip install pytest pytest-cov
- create a requirements.txt file
- configure testing in vscode as discussed in the classs
- Exercise: Write unit tests for inventory (json, yaml)