Code examples for presentation on introductory unit testing in Python using the pytest library
-
Get the code.
$ git clone https://github.com/ftobia/getting-started-pytesting-code.git $ cd getting-started-pytesting
-
Make a virtualenv.
$ virtualenv env
-
Activate your virtualenv.
$ source env/bin/activate (env)$
-
Install pytest and the sample code library.
(env)$ pip install pytest (env)$ pip install -e .
-
Run pytest
(env)$ py.test
-
Play around with the code.
Jump to certain points in the code using git checkout {name-of-tag}
.
Tags:
- beginning
- bunch
- arbitrary-markers
- chunkify
- install
- is_listy