File: doctests.py

package info (click to toggle)
python-igraph 0.11.8%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,480 kB
  • sloc: ansic: 24,545; python: 21,699; sh: 107; makefile: 35; sed: 2
file content (33 lines) | stat: -rwxr-xr-x 579 bytes parent folder | download | duplicates (3)
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
28
29
30
31
32
33
#!/usr/bin/env python
"""
Runs all the doctests in the igraph module
"""

import doctest
import sys


def run_doctests():
    import igraph

    num_failed = 0
    modules = [
        igraph,
        igraph.clustering,
        igraph.cut,
        igraph.datatypes,
        igraph.drawing.utils,
        igraph.formula,
        igraph.statistics,
        igraph.utils,
    ]
    for module in modules:
        num_failed += doctest.testmod(module)[0]
    return num_failed == 0


if __name__ == "__main__":
    if run_doctests():
        sys.exit(0)
    else:
        sys.exit(1)