Skip to content

Commit 35924de

Browse files
committed
Remove last occurences of uv.
1 parent af7a958 commit 35924de

2 files changed

Lines changed: 17 additions & 37 deletions

File tree

tests/test_hook_module.py

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from tests.conftest import run_in_subprocess
1111

1212

13-
@pytest.mark.parametrize("module_name", [True, False])
14-
def test_add_new_hook_via_cli(tmp_path, module_name):
13+
@pytest.mark.parametrize("hook_location", ["hooks/hooks.py", "hooks.hooks"])
14+
def test_add_new_hook_via_cli(tmp_path, hook_location):
1515
hooks = """
1616
import click
1717
from pytask import hookimpl
@@ -24,36 +24,24 @@ def pytask_extend_command_line_interface(cli):
2424
tmp_path.joinpath("hooks").mkdir()
2525
tmp_path.joinpath("hooks", "hooks.py").write_text(textwrap.dedent(hooks))
2626

27-
if module_name:
28-
args = (
29-
sys.executable,
30-
"-m",
31-
"pytask",
32-
"build",
33-
"--hook-module",
34-
"hooks.hooks",
35-
"--help",
36-
)
37-
else:
38-
args = (
39-
"uv",
40-
"run",
41-
"pytask",
42-
"build",
43-
"--hook-module",
44-
"hooks/hooks.py",
45-
"--help",
46-
)
47-
27+
args = (
28+
sys.executable,
29+
"-m",
30+
"pytask",
31+
"build",
32+
"--hook-module",
33+
hook_location,
34+
"--help",
35+
)
4836
result = run_in_subprocess(args, cwd=tmp_path)
4937
assert result.exit_code == ExitCode.OK
5038
assert "--new-option" in result.stdout
5139

5240

53-
@pytest.mark.parametrize("module_name", [True, False])
54-
def test_add_new_hook_via_config(tmp_path, module_name):
41+
@pytest.mark.parametrize("hook_location", ["hooks/hooks.py", "hooks.hooks"])
42+
def test_add_new_hook_via_config(tmp_path, hook_location):
5543
tmp_path.joinpath("pyproject.toml").write_text(
56-
"[tool.pytask.ini_options]\nhook_module = ['hooks/hooks.py']"
44+
f"[tool.pytask.ini_options]\nhook_module = ['{hook_location}']"
5745
)
5846

5947
hooks = """
@@ -67,16 +55,7 @@ def pytask_extend_command_line_interface(cli):
6755
tmp_path.joinpath("hooks").mkdir()
6856
tmp_path.joinpath("hooks", "hooks.py").write_text(textwrap.dedent(hooks))
6957

70-
if module_name:
71-
args = (
72-
sys.executable,
73-
"-m",
74-
"pytask",
75-
"build",
76-
"--help",
77-
)
78-
else:
79-
args = ("uv", "run", "--no-project", "pytask", "build", "--help")
58+
args = (sys.executable, "-m", "pytask", "build", "--help")
8059

8160
result = run_in_subprocess(args, cwd=tmp_path)
8261
assert result.exit_code == ExitCode.OK

tests/test_warnings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import sys
34
import textwrap
45

56
import pytest
@@ -148,7 +149,7 @@ def warn_now():
148149
path_to_warn_module.write_text(textwrap.dedent(warn_module))
149150

150151
# Cannot use runner since then warnings are not ignored by default.
151-
result = run_in_subprocess(("uv", "run", "pytask"), cwd=tmp_path)
152+
result = run_in_subprocess((sys.executable, "-m", "pytask"), cwd=tmp_path)
152153
assert result.exit_code == ExitCode.OK
153154
assert "Warnings" not in result.stdout
154155
assert "warning!!!" not in result.stdout

0 commit comments

Comments
 (0)