Commit 82442c33 by Chris Jerdonek

Renamed get_module_doctests() to get_doctests().

parent fb12f8a6
......@@ -17,9 +17,14 @@ from pystache.tests.common import PACKAGE_DIR, TEXT_DOCTEST_PATHS
# http://docs.python.org/library/doctest.html#unittest-api
#
def get_module_doctests(project_dir):
def get_doctests(text_file_dir):
"""
Return a list of TestSuite instances for all doctests in the pacakqge.
Return a list of TestSuite instances for all doctests in the project.
Arguments:
text_file_dir: the directory in which to search for all text files
(i.e. non-module files) containing doctests.
"""
suites = []
......@@ -29,7 +34,7 @@ def get_module_doctests(project_dir):
#
# http://docs.python.org/library/doctest.html#doctest.DocFileSuite
#
paths = [os.path.normpath(os.path.join(project_dir, path)) for path in TEXT_DOCTEST_PATHS]
paths = [os.path.normpath(os.path.join(text_file_dir, path)) for path in TEXT_DOCTEST_PATHS]
for path in paths:
suite = doctest.DocFileSuite(path, module_relative=False)
suites.append(suite)
......
......@@ -12,7 +12,7 @@ import sys
from unittest import TestProgram
from pystache.tests.common import PACKAGE_DIR, PROJECT_DIR
from pystache.tests.doctesting import get_module_doctests
from pystache.tests.doctesting import get_doctests
UNITTEST_FILE_PREFIX = "test_"
......@@ -145,7 +145,7 @@ class _PystacheTestProgram(TestProgram):
"""
def runTests(self):
doctest_suites = get_module_doctests(self._project_dir)
doctest_suites = get_doctests(self._project_dir)
# self.test is a unittest.TestSuite instance:
# http://docs.python.org/library/unittest.html#unittest.TestSuite
self.test.addTests(doctest_suites)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment