comparison env/lib/python3.7/site-packages/networkx/testing/test.py @ 2:6af9afd405e9 draft

"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author shellac
date Thu, 14 May 2020 14:56:58 -0400
parents 26e78fe6e8c4
children
comparison
equal deleted inserted replaced
1:75ca89e9b81c 2:6af9afd405e9
1 #!/usr/bin/env python
2
3
4 def run(verbosity=1, doctest=False):
5 """Run NetworkX tests.
6
7 Parameters
8 ----------
9 verbosity: integer, optional
10 Level of detail in test reports. Higher numbers provide more detail.
11
12 doctest: bool, optional
13 True to run doctests in code modules
14 """
15
16 import pytest
17
18 pytest_args = ['-l']
19
20 if verbosity and int(verbosity) > 1:
21 pytest_args += ["-" + "v"*(int(verbosity)-1)]
22
23 if doctest:
24 pytest_args += ["--doctest-modules"]
25
26 pytest_args += ["--pyargs", "networkx"]
27
28 try:
29 code = pytest.main(pytest_args)
30 except SystemExit as exc:
31 code = exc.code
32
33 return (code == 0)
34
35
36 if __name__ == "__main__":
37 run()