Closed baconbm closed 5 years ago
After researching the options available, I believe that pytest
is our best option for our unit testing needs. unittest
is built into the python standard but it utilizes the JUnit
framework and requires a bit more overhead than our project needs. pytest
is easy to install and use, you can find the download page here.
Testing scripts can either begin with "test" or end with "_test". This helps the pytest
library identify where the test code is located. I propose beginning test scripts with "test\". This will allow us to implement automation easier down the line.
To run the test scripts, open the command line to where the test script is located, then execute it with >py.test test_script_name.py.
I've made a gist with some sample code that tests our extractURL function in the botSetup.py file that you can see here
Closed in PR #38
Is your feature request related to a problem? Please describe. Our project needs to include unit testing in order to ensure full code coverage of all possible test cases.
Describe the solution you'd like Before code can be deployed it must pass all unit tests that are related to the functions that are modified within the pull request.
Additional context Unit testing has been discussed in CS298. There are several unit test packages for python. We will need to weigh the pros and cons of what will work for this project.