-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
40 lines (29 loc) · 1.1 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
import nox
nox.options.default_venv_backend = "uv"
@nox.session
def lint(session: nox.Session) -> None:
"""Runs the linter."""
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", "--show-diff-on-failure", *session.posargs)
@nox.session
def tests(session) -> None:
"""Runs the test suite."""
testfiles = session.posargs if session.posargs else ["tests"]
session.install(".[testing]")
session.install("pytest-xdist")
session.run("pytest", "-n", "auto", "--durations=10", "--durations-min=1.0", *testfiles)
@nox.session
def licensecheck(session) -> None:
"""Runs the license check."""
session.install("licensecheck")
session.run("licensecheck")
@nox.session(default=False)
def system_tests(session) -> None:
"""Runs the system test - slow"""
session.install(".[testing]")
session.run("pytest", "--durations=10", "system_tests")
@nox.session(default=False)
def tests_structure(session) -> None:
"""Performs a check on the test structure."""
session.install("check-tests-structure")
session.run("check-tests-structure", "hook")