How Do I Create Doc Tests?
- Keywords:
- doctests
- Last updated by:
- Eduardo Ribeiro
Install the developer branch of OSHIP, described in https:/
You will then have access to the complete OSHIP environment including the ZODB at a Python prompt.
Next you will need to import the module that you will be creating tests on.
Now simply create instances of the classes that you want to test. Edge cases, failures, etc. Copy this output from your terminal into the class docstring and it will be detected as a doctest by the testing framework.
You now will simply copy the python prompt with the tests you made in a text file in the directory ./tests/
You can see some .py file in the tests directory. Those files were part of an aproach that used a complete test substructure unit, but with grok, that process now is much simplified and we are not using those files for the time being.
You can see more information on http://