1 # -*- coding: utf-8; -*-
3 # test/test_tutorial.py
4 # Part of Gajja, a Python test double library.
6 # Copyright © 2016 Ben Finney <ben+python@benfinney.id.au>
8 # This is free software: you may copy, modify, and/or distribute this work
9 # under the terms of the GNU General Public License as published by the
10 # Free Software Foundation; version 3 of that license or any later version.
11 # No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
13 """ Test suite for tutorial examples. """
15 from __future__
import (absolute_import
, unicode_literals
)
21 __package__
= str("test")
22 __import__(__package__
)
24 this_dir
= os
.path
.dirname(__file__
)
25 doc_dir
= os
.path
.join(os
.path
.pardir
, "doc")
28 def load_tests(loader
, tests
, pattern
):
29 """ Test discovery hook to load test cases for this module.
31 :param loader: The `unittest.TestLoader` instance to use for
33 :param tests: Collection of cases already loaded for this
35 :param pattern: File glob pattern to match test modules.
36 :return: A `unittest.TestSuite` instance comprising the
37 modified test suite for this module.
39 See the `load_tests protocol`_ section of the Python
40 `unittest` documentation.
42 .. _load_tests protocol:
43 https://docs.python.org/3/library/unittest.html#load-tests-protocol
46 tutorial_file_path
= os
.path
.join(doc_dir
, "tutorial.txt")
47 tests
.addTests(doctest
.DocFileSuite(
49 optionflags
=doctest
.NORMALIZE_WHITESPACE
))
58 # vim: fileencoding=utf-8 filetype=python :