-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathnoxfile.py
128 lines (113 loc) · 2.78 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import pathlib
import nox
_py_versions = range(10, 14)
@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(".[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,
)
@nox.session(python=None)
def test_new_type(session):
session.env["COGENT3_NEW_TYPE"] = "1"
session.chdir("tests")
session.run(
"pytest",
"-s",
"--ignore",
"test_app_mpi.py",
"--ignore",
"test_core/test_alignment.py",
"--ignore",
"test_core/test_alphabet.py",
"--ignore",
"test_core/test_annotation.py",
"--ignore",
"test_core/test_genetic_code.py",
"--ignore",
"test_core/test_moltype.py",
"--ignore",
"test_core/test_sequence.py",
"--ignore",
"test_core/test_seq_aln_integration.py",
"--ignore",
"test_core/test_core_standalone.py",
"--ignore",
"test_util/test_recode_alignment.py",
"-m",
"not slow",
*session.posargs,
)