test Package¶
test Package¶
Unit tests for the NLTK modules. These tests are intended to ensure that changes that we make to NLTK’s code don’t accidentally introduce bugs.
Use doctest_driver.py to run the tests:
doctest_driver.py --help
NB. Popular options for NLTK documentation are:
--ellipsis --normalize_whitespace
align_fixt Module¶
all Module¶
Test suite that runs all NLTK tests.
This module, nltk.test.all, is named as the NLTK test_suite in the project’s setup-eggs.py file. Here, we create a test suite that runs all of our doctests, and return it for processing by the setuptools test harness.
corpus_fixt Module¶
doctest_driver Module¶
doctest_nose_plugin Module¶
- class nltk.test.doctest_nose_plugin.DoctestFix[source]¶
Bases: nltk.test.doctest_nose_plugin.DoctestPluginHelper, nose.plugins.doctests.Doctest
- class nltk.test.doctest_nose_plugin.DoctestPluginHelper¶
Bases: object
This mixin adds print_function future import to all test cases.
It also adds support for ‘#doctest +ALLOW_UNICODE’ option that makes DocTestCase think u’foo’ == ‘foo’.
- configure(options, config)¶
- loadTestsFromFile(filename)¶
- loadTestsFromModule(module)¶
Load doctests from the module.