def __init__(self):
"""
Uses :meth:`unittest.TestSuite.addTests` to add :obj:`doctest.DocFileSuite`
and :obj:`doctest.DocTestSuite` tests.
"""
readme_file_name = \
os.path.realpath(
os.path.join(os.path.dirname(__file__), "..", "README.rst")
)
examples_rst_file_name = \
os.path.realpath(
os.path.join(
os.path.dirname(__file__),
"..",
"docs",
"source",
"examples",
"index.rst"
)
)
suite = _unittest.TestSuite()
if os.path.exists(readme_file_name):
suite.addTests(
_doctest.DocFileSuite(
readme_file_name,
module_relative=False,
optionflags=_doctest.NORMALIZE_WHITESPACE
)
)
if os.path.exists(examples_rst_file_name):
suite.addTests(
_doctest.DocFileSuite(
examples_rst_file_name,
module_relative=False,
optionflags=_doctest.NORMALIZE_WHITESPACE
)
)
suite.addTests(
_doctest.DocTestSuite(
_array_split,
optionflags=_doctest.NORMALIZE_WHITESPACE
)
)
suite.addTests(
_doctest.DocTestSuite(
_split,
optionflags=_doctest.NORMALIZE_WHITESPACE
)
)
_unittest.TestSuite.__init__(self, suite)
评论列表
文章目录