File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 26
26
- name : Run pytest
27
27
run : |
28
28
set -o pipefail
29
- uv run pytest -- junitxml= pytest.xml | tee pytest-coverage.txt
29
+ uv run nox -s test -- -- junitxml pytest.xml | tee pytest-coverage.txt
30
30
31
31
- name : Pytest coverage comment
32
32
uses : MishaKav/pytest-coverage-comment@v1
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ class CLIArgs(
10
10
):
11
11
"""CLIArgs is a class that extends BaseSettings to handle command line arguments."""
12
12
13
+ junitxml : str | None = None
14
+
13
15
@classmethod
14
16
def parse (cls , posargs : list [str ]) -> "CLIArgs" :
15
17
"""Parse command line arguments from the provided list.
@@ -78,6 +80,12 @@ def test(session: nox.Session) -> None:
78
80
>>> uv run nox -s test
79
81
80
82
"""
81
- session .run ("uv" , "run" , "pytest" )
83
+ args = CLIArgs .parse (session .posargs )
84
+
85
+ command = ["uv" , "run" , "pytest" ]
86
+ if args .junitxml :
87
+ command .append (f"--junitxml={ args .junitxml } " )
88
+
89
+ session .run (* command )
82
90
83
91
session .log ("✅ Testing completed successfully." )
You can’t perform that action at this time.
0 commit comments