Skip to content

Commit 83a5dba

Browse files
authored
Merge pull request #564 from sanders41/justfile
Add option to pass pytest arguments in justfile
2 parents c87d6f5 + d5be588 commit 83a5dba

4 files changed

+13
-13
lines changed

src/project_generator.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ fn create_poetry_justfile(module: &str) -> String {
976976
@ruff-format:
977977
poetry run ruff format {module} tests
978978
979-
@test:
980-
-poetry run pytest -x
979+
@test *args="":
980+
-poetry run pytest {{{{args}}}}
981981
982982
@install:
983983
poetry install
@@ -1039,8 +1039,8 @@ fn create_pyo3_justfile(module: &str, pyo3_python_manager: &Pyo3PythonManager) -
10391039
@ruff-format:
10401040
ub run ruff format {module} tests
10411041
1042-
@test:
1043-
uv run pytest
1042+
@test *args="":
1043+
uv run pytest {{{{args}}}}
10441044
"#
10451045
)
10461046
}
@@ -1093,8 +1093,8 @@ fn create_pyo3_justfile(module: &str, pyo3_python_manager: &Pyo3PythonManager) -
10931093
@ruff-format:
10941094
ruff format {module} tests
10951095
1096-
@test:
1097-
pytest
1096+
@test *arg="":
1097+
pytest {{{{args}}}}
10981098
"#
10991099
)
11001100
}
@@ -1123,8 +1123,8 @@ fn create_setuptools_justfile(module: &str) -> String {
11231123
@ruff-format:
11241124
python -m ruff format {module} tests
11251125
1126-
@test:
1127-
-python -m pytest -x
1126+
@test *args="":
1127+
-python -m pytest {{{{args}}}}
11281128
11291129
@install:
11301130
python -m pip install -r requirements-dev.txt
@@ -1154,8 +1154,8 @@ fn create_uv_justfile(module: &str) -> String {
11541154
@ruff-format:
11551155
uv run ruff format {module} tests
11561156
1157-
@test:
1158-
-uv run pytest -x
1157+
@test *args="":
1158+
-uv run pytest {{{{args}}}}
11591159
11601160
@lock:
11611161
uv lock

src/snapshots/python_project__project_generator__tests__save_justfile_maturin.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"@_default:\n just --list\n\n@lock:\n uv lock\n\n@develop:\n uv run maturin develop\n\n@develop-release:\n uv run maturin develop -r\n\n@install: && develop\n uv sync --frozen --all-extras\n\n@install-release: && develop-release\n uv sync --frozen --all-extras\n\n@lint:\n echo cargo check\n just --justfile {{justfile()}} check\n echo cargo clippy\n just --justfile {{justfile()}} clippy\n echo cargo fmt\n just --justfile {{justfile()}} fmt\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff check\n just --justfile {{justfile()}} ruff-check\n echo ruff formatting\n just --justfile {{justfile()}} ruff-format\n\n@check:\n cargo check\n\n@clippy:\n cargo clippy --all-targets\n\n@fmt:\n cargo fmt --all -- --check\n\n@mypy:\n uv run mypy my_project tests\n\n@ruff-check:\n uv run ruff check my_project tests --fix\n\n@ruff-format:\n ub run ruff format my_project tests\n\n@test:\n uv run pytest\n"
5+
"@_default:\n just --list\n\n@lock:\n uv lock\n\n@develop:\n uv run maturin develop\n\n@develop-release:\n uv run maturin develop -r\n\n@install: && develop\n uv sync --frozen --all-extras\n\n@install-release: && develop-release\n uv sync --frozen --all-extras\n\n@lint:\n echo cargo check\n just --justfile {{justfile()}} check\n echo cargo clippy\n just --justfile {{justfile()}} clippy\n echo cargo fmt\n just --justfile {{justfile()}} fmt\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff check\n just --justfile {{justfile()}} ruff-check\n echo ruff formatting\n just --justfile {{justfile()}} ruff-format\n\n@check:\n cargo check\n\n@clippy:\n cargo clippy --all-targets\n\n@fmt:\n cargo fmt --all -- --check\n\n@mypy:\n uv run mypy my_project tests\n\n@ruff-check:\n uv run ruff check my_project tests --fix\n\n@ruff-format:\n ub run ruff format my_project tests\n\n@test *args=\"\":\n uv run pytest {{args}}\n"

src/snapshots/python_project__project_generator__tests__save_justfile_poetry.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"@_default:\n just --list\n\n@lint:\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff-check\n just --justfile {{justfile()}} ruff-check\n echo ruff-format\n just --justfile {{justfile()}} ruff-format\n\n@mypy:\n poetry run mypy my_project tests\n\n@ruff-check:\n poetry run ruff check my_project tests\n\n@ruff-format:\n poetry run ruff format my_project tests\n\n@test:\n -poetry run pytest -x\n\n@install:\n poetry install\n"
5+
"@_default:\n just --list\n\n@lint:\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff-check\n just --justfile {{justfile()}} ruff-check\n echo ruff-format\n just --justfile {{justfile()}} ruff-format\n\n@mypy:\n poetry run mypy my_project tests\n\n@ruff-check:\n poetry run ruff check my_project tests\n\n@ruff-format:\n poetry run ruff format my_project tests\n\n@test *args=\"\":\n -poetry run pytest {{args}}\n\n@install:\n poetry install\n"

src/snapshots/python_project__project_generator__tests__save_justfile_setuptools.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"@_default:\n just --list\n\n@lint:\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff-check\n just --justfile {{justfile()}} ruff-check\n echo ruff-format\n just --justfile {{justfile()}} ruff-format\n\n@mypy:\n python -m mypy my_project tests\n\n@ruff-check:\n python -m ruff check my_project tests\n\n@ruff-format:\n python -m ruff format my_project tests\n\n@test:\n -python -m pytest -x\n\n@install:\n python -m pip install -r requirements-dev.txt\n"
5+
"@_default:\n just --list\n\n@lint:\n echo mypy\n just --justfile {{justfile()}} mypy\n echo ruff-check\n just --justfile {{justfile()}} ruff-check\n echo ruff-format\n just --justfile {{justfile()}} ruff-format\n\n@mypy:\n python -m mypy my_project tests\n\n@ruff-check:\n python -m ruff check my_project tests\n\n@ruff-format:\n python -m ruff format my_project tests\n\n@test *args=\"\":\n -python -m pytest {{args}}\n\n@install:\n python -m pip install -r requirements-dev.txt\n"

0 commit comments

Comments
 (0)