Path: blob/master/venv/Lib/site-packages/bs4/tests/test_docs.py
811 views
"Test harness for doctests."12# pylint: disable-msg=E0611,W014234__metaclass__ = type5__all__ = [6'additional_tests',7]89import atexit10import doctest11import os12#from pkg_resources import (13# resource_filename, resource_exists, resource_listdir, cleanup_resources)14import unittest1516DOCTEST_FLAGS = (17doctest.ELLIPSIS |18doctest.NORMALIZE_WHITESPACE |19doctest.REPORT_NDIFF)202122# def additional_tests():23# "Run the doc tests (README.txt and docs/*, if any exist)"24# doctest_files = [25# os.path.abspath(resource_filename('bs4', 'README.txt'))]26# if resource_exists('bs4', 'docs'):27# for name in resource_listdir('bs4', 'docs'):28# if name.endswith('.txt'):29# doctest_files.append(30# os.path.abspath(31# resource_filename('bs4', 'docs/%s' % name)))32# kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)33# atexit.register(cleanup_resources)34# return unittest.TestSuite((35# doctest.DocFileSuite(*doctest_files, **kwargs)))363738