Skip to content

Commit b693b47

Browse files
committed
fix: args
1 parent 0a88183 commit b693b47

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Run pytest
2727
run: |
2828
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
3030
3131
- name: Pytest coverage comment
3232
uses: MishaKav/pytest-coverage-comment@v1

noxfile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class CLIArgs(
1010
):
1111
"""CLIArgs is a class that extends BaseSettings to handle command line arguments."""
1212

13+
junitxml: str | None = None
14+
1315
@classmethod
1416
def parse(cls, posargs: list[str]) -> "CLIArgs":
1517
"""Parse command line arguments from the provided list.
@@ -78,6 +80,12 @@ def test(session: nox.Session) -> None:
7880
>>> uv run nox -s test
7981
8082
"""
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)
8290

8391
session.log("✅ Testing completed successfully.")

0 commit comments

Comments
 (0)