📚 The CoCalc Library - books, templates and other resources
License: OTHER
Kernel: Python 2
This notebook was prepared by Donne Martin. Source and license info is on GitHub.
Nose Unit Tests with IPython Notebook
Nose
Testing is a vital part of software development. Nose extends unittest to make testing easier.
Install Nose
Run the following command line:
In [ ]:
Create the Code
Save your code to a file with the %%file magic:
In [1]:
Out[1]:
Overwriting type_util.py
Create the Nose Tests
Save your test to a file with the %%file magic:
In [2]:
Out[2]:
Overwriting tests/test_type_util.py
Run the Nose Tests
Run the following command line:
In [3]:
Out[3]:
core.tests.test_type_util.TestUtil.test_convert_to_list ... ok
core.tests.test_type_util.TestUtil.test_is_iterable ... ok
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK