This assumes you have setup your environment as described in [run_tests.md] and that you are in your virtualenv.
If you get stuck, take a peek at the solution.
-
This time we will be writing tests for safecatmath.py. This module contains a new version of
cat_years_to_hooman_years
. -
Look at the existing tests. You can see we have similar test cases to the ones we had for
cat_years_to_hooman_years
but several more cases have been added:test__cat_years_to_hooman_years__less_0__raises
test__cat_years_to_hooman_years__older_than_1000__raises
test__cat_years_to_hooman_years__string__raises
test__cat_years_to_hooman_years__nan__raises
-
Fill in the body of these tests, using
pytest.raises
. -
When you have filled in the body of these tests, run them:
(catpy)user@host:~/catinabox$ python setup.py test
- When the tests run successfully, push them to your pull request:
(catpy)user@host:~/catinabox$ git commit -a
(catpy)user@host:~/catinabox$ git push origin master