asynciomainproxy-ticket
Last change
on this file since 459a982 was
459a982,
checked in by Fiona Klute <fiona.klute@…>, 3 years ago
|
Include doctest for the mgstest Python package in test suite runs
This should help with both detecting issues in the package itself, and
making sure documentation and implementation match.
|
-
Property mode set to
100755
|
File size:
584 bytes
|
Line | |
---|
1 | #!/usr/bin/python3 |
---|
2 | |
---|
3 | if __name__ == "__main__": |
---|
4 | import doctest |
---|
5 | import importlib |
---|
6 | import sys |
---|
7 | modules = [ |
---|
8 | 'mgstest', |
---|
9 | 'mgstest.hooks', |
---|
10 | 'mgstest.http', |
---|
11 | 'mgstest.services', |
---|
12 | 'mgstest.tests' |
---|
13 | ] |
---|
14 | |
---|
15 | totals = (0, 0) |
---|
16 | for m in modules: |
---|
17 | mod = importlib.import_module(m) |
---|
18 | result = doctest.testmod(m=mod, verbose=True) |
---|
19 | totals = tuple(sum(x) for x in zip(totals, result)) |
---|
20 | |
---|
21 | fails, count = totals |
---|
22 | print(f'Summary over all modules: {fails} out of {count} tests failed.') |
---|
23 | if fails > 0: |
---|
24 | sys.exit(1) |
---|
Note: See
TracBrowser
for help on using the repository browser.