-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnoxfile.py
More file actions
42 lines (31 loc) · 1.04 KB
/
noxfile.py
File metadata and controls
42 lines (31 loc) · 1.04 KB
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
"""Collection of tests for code quality.
The tests can be run via the following command:
```bash
pip install nox
nox
```
If you want to run only a subset of tests, they can be specified via
```nox -s <session_name>```
where <session_name> is the name of the respective function in this script.
Or via
```nox -t <tag_name>```
where <tag_name> is the name of the tag
(e.g. "style" for code style related testing or "tests" for testing of the code functionality).
"""
import nox
nox.needs_version = ">=2025.02"
@nox.session(reuse_venv=True)
def ruff(session: nox.Session) -> None:
"""Code check using ruff."""
session.install("ruff", ".")
session.run("ruff", "check", "tvha/")
@nox.session(reuse_venv=True)
def mypy(session: nox.Session) -> None:
"""Code check using mypy."""
session.install("mypy", ".")
session.run("mypy", ".")
@nox.session(python=["3.13"], reuse_venv=True)
def pytest(session: nox.Session) -> None:
"""Test suite using pytest."""
session.install("pytest", ".")
session.run("python", "-m", "pytest", "-v")