Presentation by Greg Detre on unit testing in Python at Tampa Bay Python meetup on 13th October 2015.
see:
http://bit.ly/1GELH73 (requires Google Hangouts app & Google account)
cd ~/PATH/TO/DEV/
git clone git@github.com:gregdetre/unit-testing-pres.git
cd unit-testing-pres
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
Or, if you have trouble, just download the tarball.
Create test_template0.py
:
def test_blah():
assert True
Then run:
$ nose2 test_template0
Or if you weren't able to install nose2
, you can use the more verbose unittest
standard library in test_template2.py
:
$ python test_template2.py
Have a look in test_template1.py
and test_template2.py
for further examples and usage instructions.