1
# Copyright 2009 Canonical Ltd. All rights reserved.
3
# This file is part of lazr.authentication
5
# lazr.authentication is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU Lesser General Public License as published by
7
# the Free Software Foundation, version 3 of the License.
9
# lazr.authentication is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12
# License for more details.
14
# You should have received a copy of the GNU Lesser General Public License
15
# along with lazr.authentication. If not, see <http://www.gnu.org/licenses/>.
16
"Test harness for doctests."
18
# pylint: disable=E0611
29
# pylint: disable=F0401
30
from pkg_resources import (
31
resource_filename, resource_exists, resource_listdir, cleanup_resources)
35
doctest.NORMALIZE_WHITESPACE |
39
# pylint: disable=W0613
40
def load_tests(loader, tests, pattern):
41
"""Load all the doctests."""
43
if resource_exists('lazr.authentication', 'docs'):
44
for name in resource_listdir('lazr.authentication', 'docs'):
45
if name.endswith('.rst'):
47
os.path.abspath(resource_filename(
48
'lazr.authentication', 'docs/%s' % name)))
49
atexit.register(cleanup_resources)
50
tests.addTest(doctest.DocFileSuite(
51
*doctest_files, module_relative=False, optionflags=DOCTEST_FLAGS))