all.py 786 B

12345678910111213141516171819202122232425
  1. """Test suite that runs all NLTK tests.
  2. This module, `nltk.test.all`, is named as the NLTK ``test_suite`` in the
  3. project's ``setup-eggs.py`` file. Here, we create a test suite that
  4. runs all of our doctests, and return it for processing by the setuptools
  5. test harness.
  6. """
  7. import doctest, unittest
  8. from glob import glob
  9. import os.path
  10. def additional_tests():
  11. # print "here-000000000000000"
  12. # print "-----", glob(os.path.join(os.path.dirname(__file__), '*.doctest'))
  13. dir = os.path.dirname(__file__)
  14. paths = glob(os.path.join(dir, '*.doctest'))
  15. files = [os.path.basename(path) for path in paths]
  16. return unittest.TestSuite([doctest.DocFileSuite(file) for file in files])
  17. # if os.path.split(path)[-1] != 'index.rst'
  18. # skips time-dependent doctest in index.rst