77from pytask import ExitCode
88from pytask import build
99from pytask import cli
10+
1011from pytask_parallel import ParallelBackend
1112from pytask_parallel .execute import _Sleeper
12-
1313from tests .conftest import restore_sys_path_and_module_after_test_execution
1414
1515_IMPLEMENTED_BACKENDS = [
2525]
2626
2727
28- @pytest .mark .end_to_end ()
28+ @pytest .mark .end_to_end
2929@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
3030def test_parallel_execution (tmp_path , parallel_backend ):
3131 source = """
@@ -47,7 +47,7 @@ def task_2(path: Annotated[Path, Product] = Path("out_2.txt")):
4747 assert tmp_path .joinpath ("out_2.txt" ).exists ()
4848
4949
50- @pytest .mark .end_to_end ()
50+ @pytest .mark .end_to_end
5151@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
5252def test_parallel_execution_w_cli (runner , tmp_path , parallel_backend ):
5353 source = """
@@ -77,7 +77,7 @@ def task_2(path: Annotated[Path, Product] = Path("out_2.txt")):
7777 assert tmp_path .joinpath ("out_2.txt" ).exists ()
7878
7979
80- @pytest .mark .end_to_end ()
80+ @pytest .mark .end_to_end
8181@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
8282def test_stop_execution_when_max_failures_is_reached (tmp_path , parallel_backend ):
8383 source = """
@@ -105,7 +105,7 @@ def task_3(): time.sleep(3)
105105 assert len (session .execution_reports ) == 2
106106
107107
108- @pytest .mark .end_to_end ()
108+ @pytest .mark .end_to_end
109109@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
110110def test_task_priorities (tmp_path , parallel_backend ):
111111 source = """
@@ -146,7 +146,7 @@ def task_5():
146146 assert last_task_name .endswith (("task_2" , "task_5" ))
147147
148148
149- @pytest .mark .end_to_end ()
149+ @pytest .mark .end_to_end
150150@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
151151@pytest .mark .parametrize ("show_locals" , [True , False ])
152152def test_rendering_of_tracebacks_with_rich (
@@ -172,7 +172,7 @@ def task_raising_error():
172172 assert ("[0, 1, 2, 3, 4]" in result .output ) is show_locals
173173
174174
175- @pytest .mark .end_to_end ()
175+ @pytest .mark .end_to_end
176176@pytest .mark .parametrize (
177177 "parallel_backend" ,
178178 # Capturing warnings is not thread-safe.
@@ -207,7 +207,7 @@ def task_example(produces):
207207 assert "task_example.py::task_example[1]" in warnings_block
208208
209209
210- @pytest .mark .unit ()
210+ @pytest .mark .unit
211211def test_sleeper ():
212212 sleeper = _Sleeper (timings = [1 , 2 , 3 ], timing_idx = 0 )
213213
@@ -229,7 +229,7 @@ def test_sleeper():
229229 assert 1 <= end - start <= 2
230230
231231
232- @pytest .mark .end_to_end ()
232+ @pytest .mark .end_to_end
233233@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
234234def test_task_that_return (runner , tmp_path , parallel_backend ):
235235 source = """
@@ -249,7 +249,7 @@ def task_example() -> Annotated[str, Path("file.txt")]:
249249 )
250250
251251
252- @pytest .mark .end_to_end ()
252+ @pytest .mark .end_to_end
253253@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
254254def test_task_without_path_that_return (runner , tmp_path , parallel_backend ):
255255 source = """
@@ -270,7 +270,7 @@ def test_task_without_path_that_return(runner, tmp_path, parallel_backend):
270270 )
271271
272272
273- @pytest .mark .end_to_end ()
273+ @pytest .mark .end_to_end
274274@pytest .mark .parametrize ("flag" , ["--pdb" , "--trace" , "--dry-run" ])
275275@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
276276def test_parallel_execution_is_deactivated (runner , tmp_path , flag , parallel_backend ):
@@ -283,7 +283,7 @@ def test_parallel_execution_is_deactivated(runner, tmp_path, flag, parallel_back
283283 assert "Started 2 workers" not in result .output
284284
285285
286- @pytest .mark .end_to_end ()
286+ @pytest .mark .end_to_end
287287@pytest .mark .parametrize ("code" , ["breakpoint()" , "import pdb; pdb.set_trace()" ])
288288@pytest .mark .parametrize (
289289 "parallel_backend" ,
@@ -298,7 +298,7 @@ def test_raise_error_on_breakpoint(runner, tmp_path, code, parallel_backend):
298298 assert "You cannot use 'breakpoint()'" in result .output
299299
300300
301- @pytest .mark .end_to_end ()
301+ @pytest .mark .end_to_end
302302@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
303303def test_task_partialed (runner , tmp_path , parallel_backend ):
304304 source = """
@@ -321,7 +321,7 @@ def create_text(text):
321321 assert tmp_path .joinpath ("file.txt" ).exists ()
322322
323323
324- @pytest .mark .end_to_end ()
324+ @pytest .mark .end_to_end
325325@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
326326def test_execute_tasks_and_pass_values_by_python_node_return (
327327 runner , tmp_path , parallel_backend
@@ -349,7 +349,7 @@ def task_create_file(
349349 assert tmp_path .joinpath ("file.txt" ).read_text () == "This is the text."
350350
351351
352- @pytest .mark .end_to_end ()
352+ @pytest .mark .end_to_end
353353@pytest .mark .parametrize ("parallel_backend" , _IMPLEMENTED_BACKENDS )
354354def test_execute_tasks_and_pass_values_by_python_node_product (
355355 runner , tmp_path , parallel_backend
0 commit comments