Changeset 461fd38 in mod_gnutls


Ignore:
Timestamp:
Feb 16, 2021, 11:45:54 AM (7 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master
Children:
3d7865f
Parents:
40e845b
Message:

Automagically detect test framework modules for doctest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/doctest-mgstest.py

    r40e845b r461fd38  
    11#!/usr/bin/python3
     2import doctest
     3import importlib
     4import sys
     5from pathlib import Path
    26
    37if __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.softhsm',
    13         'mgstest.tests'
    14     ]
     8    modules = set()
     9    for p in Path('mgstest').glob('**/*.py'):
     10        if p.stem == '__init__':
     11            modules.add('.'.join(p.parts[:-1]))
     12        else:
     13            modules.add('.'.join((*p.parts[:-1], p.stem)))
    1514
    1615    totals = (0, 0)
Note: See TracChangeset for help on using the changeset viewer.