-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
26 lines (22 loc) · 938 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Javier Escalada Gómez
# All rights reserved.
# License: BSD 3-Clause Clear License (see LICENSE for details)
import unittest
import doctest
import doctest_utils
import py2doc
import doc2md
"""
It loads the [doctest](https://docs.python.org/3/library/doctest) and [expose
them as unittests](https://docs.python.org/3/library/doctest.html#unittest-api).
"""
def load_tests(loader, tests, ignore):
parser = doctest_utils.MarkdownDocTestParser()
test_finder = doctest.DocTestFinder(parser=parser)
tests.addTests(doctest.DocTestSuite(py2doc, test_finder=test_finder))
tests.addTests(doctest.DocTestSuite(doc2md, test_finder=test_finder))
# tests.addTests(doctest.DocFileSuite("../README.md.in",
# globs={**py2doc.__dict__, **doc2md.__dict__}},
# parser=MarkdownTestParser()))
return tests