-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
35 lines (30 loc) · 883 Bytes
/
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
import nox
@nox.session
def lint(session):
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", "--show-diff-on-failure")
@nox.session
@nox.parametrize(
"python,runner",
[("2.7", "unittest2")]
+ [
(python, runner)
for python in ["2.7", "3.7", "3.8", "3.9", "3.10"]
for runner in ["nose", "nose2", "unittest", "pytest"]
if (python, runner) != ("3.10", "nose")
],
)
def test(session, runner):
if runner != "unittest":
session.install(runner)
session.install("-e", ".")
if runner == "nose":
session.run("nosetests")
elif runner == "nose2":
session.run("nose2")
elif runner == "unittest":
session.run("python", "-m", "unittest")
elif runner == "unittest2":
session.run("unit2")
elif runner == "pytest":
session.run("pytest")