-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
27 lines (22 loc) · 976 Bytes
/
tests.py
File metadata and controls
27 lines (22 loc) · 976 Bytes
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
27
# -*- coding: utf-8 -*-
# Copyright (c) Javier Escalada Gómez
# All rights reserved.
# License: BSD 3-Clause Clear License (see LICENSE for details)
import unittest
import doctest
from microdoc import doctest_utils
from microdoc import py2doc
from microdoc 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