-
Notifications
You must be signed in to change notification settings - Fork 53
/
noxfile.py
95 lines (82 loc) · 1.96 KB
/
noxfile.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import pathlib
import nox
_py_versions = range(9, 13)
@nox.session(python=[f"3.{v}" for v in _py_versions])
def test_slow(session):
session.install(".[test]")
session.chdir("tests")
session.run(
"pytest",
"-m",
"slow",
)
@nox.session(python=[f"3.{v}" for v in _py_versions])
def test(session):
session.install("-e.[test]")
# doctest modules within cogent3/app
session.chdir("src/cogent3/app")
session.run(
"pytest",
"-s",
"-x",
"--doctest-modules",
".",
)
session.chdir("../../../tests")
session.run(
"pytest",
"-s",
"-x",
"--ignore",
"test_app_mpi.py",
"-m",
"not slow",
*session.posargs,
)
@nox.session(python=[f"3.{v}" for v in _py_versions])
def test_module_docs(session):
"""doctest examples in a module"""
session.install(".[test]")
# doctest modules within cogent3/app
session.chdir("src/cogent3/app")
session.run(
"pytest",
"-s",
"--doctest-modules",
".",
)
@nox.session(python=[f"3.{v}" for v in _py_versions])
def testmpi(session):
session.install(".[test]")
session.install("mpi4py")
py = pathlib.Path(session.bin_paths[0]) / "python"
session.chdir("tests")
session.run(
"mpiexec",
"-n",
"2",
str(py),
"-m",
"mpi4py.futures",
"-m",
"pytest",
"-x",
"test_app/test_app_mpi.py",
external=True,
)
@nox.session(python=[f"3.{v}" for v in _py_versions])
def testdocs(session):
py = pathlib.Path(session.bin_paths[0]) / "python"
session.install(".[doc]")
session.chdir("doc")
for docdir in ("app", "cookbook", "draw", "examples"):
session.run(
str(py),
"doctest_rsts.py",
"-f",
docdir,
"-1",
"-s",
"rst",
external=True,
)