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 WITHOUT
10
# 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-msg=E0611,W0142
28
# pylint: disable-msg=F0401
29
from pkg_resources import (
30
resource_filename, resource_exists, resource_listdir, cleanup_resources)
35
doctest.NORMALIZE_WHITESPACE |
39
def additional_tests():
40
"Run the doc tests (README.txt and docs/*, if any exist)"
42
os.path.abspath(resource_filename('lazr.authentication', 'README.txt'))]
43
if resource_exists('lazr.authentication', 'docs'):
44
for name in resource_listdir('lazr.authentication', 'docs'):
45
if name.endswith('.txt'):
48
resource_filename('lazr.authentication', 'docs/%s' % name)))
49
kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)
50
atexit.register(cleanup_resources)
51
return unittest.TestSuite((
52
doctest.DocFileSuite(*doctest_files, **kwargs)))