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.

nltk.test.all.additional_tests()[source]

childes_fixt Module

nltk.test.childes_fixt.setup_module(module)[source]

classify_fixt Module

nltk.test.classify_fixt.setup_module(module)[source]

compat_fixt Module

nltk.test.compat_fixt.setup_module(module)[source]

corpus_fixt Module

discourse_fixt Module

nltk.test.discourse_fixt.setup_module(module)[source]

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.

gluesemantics_malt_fixt Module

nltk.test.gluesemantics_malt_fixt.setup_module(module)[source]

inference_fixt Module

nltk.test.inference_fixt.setup_module(module)[source]

nonmonotonic_fixt Module

nltk.test.nonmonotonic_fixt.setup_module(module)[source]

portuguese_en_fixt Module

nltk.test.portuguese_en_fixt.setup_module(module)[source]

probability_fixt Module

nltk.test.probability_fixt.setup_module(module)[source]

runtests Module

segmentation_fixt Module

nltk.test.segmentation_fixt.setup_module(module)[source]

semantics_fixt Module

nltk.test.semantics_fixt.setup_module(module)[source]

wordnet_fixt Module

nltk.test.wordnet_fixt.teardown_module(module)[source]