-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
37 lines (28 loc) · 919 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
36
37
"""
This `noxfile.py` is configured to run the test suite with multiple versions of Python.
If you want to also run the test suite against multiple version of some dependency (e.g. Django),
use the `noxfile.with-packages.py` file instead.
"""
import os
import nox
# Use uv to manage venvs.
nox.options.default_venv_backend = "uv"
@nox.session()
@nox.parametrize(
"python",
[
nox.param("3.11", id="python=3.11"),
nox.param("3.12", id="python=3.12"),
],
)
def tests(session: nox.Session) -> None:
"""
Run the test suite.
"""
# Install the development dependencies.
session.install("-r", "requirements/development.txt", ".")
# When run in CircleCI, create JUnit XML test results.
commands = ["pytest"]
if "CIRCLECI" in os.environ:
commands.append(f"--junitxml=test-results/junit.{session.name}.xml")
session.run(*commands, *session.posargs)