nltk.test package

Subpackages

Submodules

nltk.test.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]

nltk.test.childes_fixt module

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

nltk.test.classify_fixt module

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

nltk.test.compat_fixt module

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

nltk.test.corpus_fixt module

nltk.test.discourse_fixt module

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

nltk.test.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[source]

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’.

‘#doctest doctestencoding=utf-8’ option that changes the encoding of doctest files

OPTION_BY_NAME = ('doctestencoding',)
configure(options, config)[source]
loadTestsFromFile(filename)[source]
loadTestsFromFileUnicode(filename)[source]
loadTestsFromModule(module)[source]

Load doctests from the module.

nltk.test.gensim_fixt module

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

nltk.test.gluesemantics_malt_fixt module

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

nltk.test.inference_fixt module

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

nltk.test.nonmonotonic_fixt module

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

nltk.test.portuguese_en_fixt module

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

nltk.test.probability_fixt module

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

nltk.test.runtests module

nltk.test.segmentation_fixt module

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

nltk.test.semantics_fixt module

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

nltk.test.translate_fixt module

nltk.test.wordnet_fixt module

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

Module contents

Unit tests for the NLTK modules. These tests are intended to ensure that source code changes don’t accidentally introduce bugs. For instructions, please see:

../../web/dev/local_testing.rst

https://github.com/nltk/nltk/blob/develop/web/dev/local_testing.rst