-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Expand file tree
/
Copy pathdont-use-uv-in-tests.patch
More file actions
155 lines (141 loc) · 6.04 KB
/
dont-use-uv-in-tests.patch
File metadata and controls
155 lines (141 loc) · 6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
diff --git a/tests/test_capture.py b/tests/test_capture.py
index ba37be8..8f70c9e 100644
--- a/tests/test_capture.py
+++ b/tests/test_capture.py
@@ -87,7 +87,7 @@ def test_show_capture_with_build(tmp_path, show_capture):
"""
tmp_path.joinpath("workflow.py").write_text(textwrap.dedent(source))
- result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
+ result = run_in_subprocess(("python", "workflow.py"), cwd=tmp_path)
assert result.exit_code == ExitCode.FAILED
@@ -128,7 +128,7 @@ def test_wrong_capture_method(tmp_path):
"""
tmp_path.joinpath("workflow.py").write_text(textwrap.dedent(source))
- result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
+ result = run_in_subprocess(("python", "workflow.py"), cwd=tmp_path)
assert result.exit_code == ExitCode.CONFIGURATION_FAILED
assert "Value 'a' is not a valid" in result.stdout
assert "Traceback" not in result.stdout
@@ -255,7 +255,7 @@ def test_capturing_unicode_with_build(tmp_path, method):
tmp_path.joinpath("workflow.py").write_text(
textwrap.dedent(source), encoding="utf-8"
)
- result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
+ result = run_in_subprocess(("python", "workflow.py"), cwd=tmp_path)
assert result.exit_code == ExitCode.OK
assert "1 Succeeded" in result.stdout
diff --git a/tests/test_config.py b/tests/test_config.py
index c46f5ed..eaa0934 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -114,7 +114,7 @@ def test_paths_are_relative_to_configuration_file(tmp_path):
session = build(paths=[Path("src")])
"""
tmp_path.joinpath("script.py").write_text(textwrap.dedent(source))
- result = run_in_subprocess(("uv", "run", "python", "script.py"), cwd=tmp_path)
+ result = run_in_subprocess(("python", "script.py"), cwd=tmp_path)
assert result.exit_code == ExitCode.OK
assert "1 Succeeded" in result.stdout
diff --git a/tests/test_dag_command.py b/tests/test_dag_command.py
index 3ca41ba..7c0c4fc 100644
--- a/tests/test_dag_command.py
+++ b/tests/test_dag_command.py
@@ -92,7 +92,7 @@ def test_create_graph_via_task(tmp_path, format_, layout, rankdir):
tmp_path.joinpath("input.txt").touch()
result = subprocess.run(
- ("uv", "run", "python", "task_example.py"),
+ ("python", "task_example.py"),
cwd=tmp_path,
check=True,
capture_output=True,
diff --git a/tests/test_execute.py b/tests/test_execute.py
index 1a23316..6532b48 100644
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -26,7 +26,7 @@ from tests.conftest import run_in_subprocess
def test_python_m_pytask(tmp_path):
tmp_path.joinpath("task_module.py").write_text("def task_example(): pass")
result = run_in_subprocess(
- ("uv", "run", "python", "-m", "pytask", tmp_path.as_posix())
+ ("python", "-m", "pytask", tmp_path.as_posix())
)
assert result.exit_code == ExitCode.OK
@@ -602,7 +602,7 @@ def test_execute_tasks_via_functional_api(tmp_path):
"""
tmp_path.joinpath("task_module.py").write_text(textwrap.dedent(source))
result = subprocess.run(
- ("uv", "run", "python", tmp_path.joinpath("task_module.py").as_posix()),
+ ("python", tmp_path.joinpath("task_module.py").as_posix()),
check=False,
)
assert result.returncode == ExitCode.OK
@@ -632,7 +632,7 @@ def test_execute_tasks_multiple_times_via_api(tmp_path):
"""
tmp_path.joinpath("task_module.py").write_text(textwrap.dedent(source))
result = run_in_subprocess(
- ("uv", "run", "python", tmp_path.joinpath("task_module.py").as_posix())
+ ("python", tmp_path.joinpath("task_module.py").as_posix())
)
assert result.exit_code == ExitCode.OK
diff --git a/tests/test_hook_module.py b/tests/test_hook_module.py
index eba4868..e26288a 100644
--- a/tests/test_hook_module.py
+++ b/tests/test_hook_module.py
@@ -25,8 +25,6 @@ def test_add_new_hook_via_cli(tmp_path, module_name):
if module_name:
args = (
- "uv",
- "run",
"python",
"-m",
"pytask",
@@ -37,8 +35,6 @@ def test_add_new_hook_via_cli(tmp_path, module_name):
)
else:
args = (
- "uv",
- "run",
"pytask",
"build",
"--hook-module",
@@ -70,9 +66,6 @@ def test_add_new_hook_via_config(tmp_path, module_name):
if module_name:
args = (
- "uv",
- "run",
- "--no-project",
"python",
"-m",
"pytask",
@@ -80,7 +73,7 @@ def test_add_new_hook_via_config(tmp_path, module_name):
"--help",
)
else:
- args = ("uv", "run", "--no-project", "pytask", "build", "--help")
+ args = ("pytask", "build", "--help")
result = run_in_subprocess(args, cwd=tmp_path)
assert result.exit_code == ExitCode.OK
diff --git a/tests/test_task.py b/tests/test_task.py
index a2f70ad..510619e 100644
--- a/tests/test_task.py
+++ b/tests/test_task.py
@@ -667,7 +667,7 @@ def test_task_will_be_executed_after_another_one_with_function_session(
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
result = subprocess.run(
- ("uv", "run", "python", "task_example.py"),
+ ("python", "task_example.py"),
cwd=tmp_path,
capture_output=True,
check=False,
diff --git a/tests/test_warnings.py b/tests/test_warnings.py
index 8811018..5aae724 100644
--- a/tests/test_warnings.py
+++ b/tests/test_warnings.py
@@ -148,7 +148,7 @@ def test_deprecation_warnings_are_not_captured(tmp_path, warning):
path_to_warn_module.write_text(textwrap.dedent(warn_module))
# Cannot use runner since then warnings are not ignored by default.
- result = run_in_subprocess(("uv", "run", "pytask"), cwd=tmp_path)
+ result = run_in_subprocess(("pytask"), cwd=tmp_path)
assert result.exit_code == ExitCode.OK
assert "Warnings" not in result.stdout
assert "warning!!!" not in result.stdout