Skip to content

Commit db34eb3

Browse files
committed
Add a uv sync test.
1 parent c0dd238 commit db34eb3

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎tests/test_package_generation.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ def test_pip_installable(
6666
)
6767

6868

69+
def test_uv_installable(
70+
venv: pytest_venv.VirtualEnvironment,
71+
generate_package: typing.Callable,
72+
) -> None:
73+
"""Test generated package is uv installable."""
74+
_, test_project_dir = generate_package()
75+
venv.install("uv", upgrade=True)
76+
# Try to install the package in virtual environment with uv
77+
uvsync = subprocess.run( # noqa: S603
78+
["cd", str(test_project_dir), "&&", "uv", "sync"],
79+
capture_output=True,
80+
check=False,
81+
)
82+
assert uvsync.returncode == 0, (
83+
f"Something went wrong with installation: {uvsync.stderr!r}"
84+
)
85+
86+
6987
@pytest.mark.parametrize("funder", ["", "STFC", "UKRI", "Wellcome Trust"])
7088
def test_optional_funder(
7189
funder: str,

0 commit comments

Comments
 (0)