Skip to content

Commit f922043

Browse files
authored
Rename functions in test. (#42)
* Improve type checking. * add., * FIx. * fix. * Update test suite. * Update lockfile. * Rename dummy test module paths to task_example
1 parent 39c3860 commit f922043

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tests/test_execute.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def task_run_jl_script(
6666
):
6767
pass
6868
"""
69-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
69+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
7070
tmp_path.joinpath("in_1.txt").touch()
7171
tmp_path.joinpath("in_2.txt").touch()
7272

@@ -109,7 +109,7 @@ def test_run_jl_script_w_task_decorator(
109109
def run_jl_script(produces=Path("out.txt")):
110110
pass
111111
"""
112-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
112+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
113113

114114
julia_script = f"""
115115
{parse_config_code}
@@ -149,7 +149,7 @@ def test_raise_error_if_julia_is_not_found(
149149
def task_run_jl_script(produces=Path("out.txt")):
150150
pass
151151
"""
152-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
152+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
153153

154154
julia_script = f"""
155155
{parse_config_code}
@@ -197,7 +197,7 @@ def task_run_jl_script(produces=Path("out.txt")):
197197
pass
198198
199199
"""
200-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
200+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
201201

202202
julia_script = f"""
203203
{parse_config_code}
@@ -237,7 +237,7 @@ def task_run_jl_script(produces=Path("out.txt")):
237237
pass
238238
239239
"""
240-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
240+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
241241

242242
julia_script = f"""
243243
{parse_config_code}
@@ -278,7 +278,7 @@ def test_run_jl_script_w_environment_in_config( # noqa: PLR0913
278278
def task_run_jl_script(produces=Path("out.txt")):
279279
pass
280280
"""
281-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
281+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
282282

283283
julia_script = f"""
284284
{parse_config_code}
@@ -332,7 +332,7 @@ def test_run_jl_script_w_environment_relative_to_task(
332332
def task_run_jl_script(produces=Path("out.txt")):
333333
pass
334334
"""
335-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
335+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
336336

337337
julia_script = f"""
338338
{parse_config_code}
@@ -364,7 +364,7 @@ def test_run_jl_script_w_custom_serializer(runner, tmp_path):
364364
def task_run_jl_script(produces=Path("out.txt")):
365365
pass
366366
"""
367-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
367+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
368368

369369
julia_script = """
370370
import JSON; config = JSON.parse(read(ARGS[1], String))
@@ -392,7 +392,7 @@ def test_run_jl_script_fails_w_multiple_markers(runner, tmp_path):
392392
def task_run_jl_script(produces=Path("out.txt")):
393393
pass
394394
"""
395-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
395+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
396396
tmp_path.joinpath("script.jl").touch()
397397

398398
result = runner.invoke(cli, [tmp_path.as_posix()])

tests/test_normal_execution_w_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_execution_w_varying_dependencies_products(
2121
import pytask
2222
from pathlib import Path
2323
24-
def task_dummy(
24+
def task_example(
2525
depends_on=[Path(p) for p in {dependencies}],
2626
produces=[Path(p) for p in {products}],
2727
):
@@ -32,7 +32,7 @@ def task_dummy(
3232
for product in produces:
3333
product.touch()
3434
"""
35-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
35+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
3636
for dependency in dependencies:
3737
tmp_path.joinpath(dependency).touch()
3838

tests/test_parallel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_parallel_parametrization_over_source_files_w_loop(
5757
def task_execute_julia(produces=Path(f"{{i}}.csv")):
5858
pass
5959
"""
60-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
60+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
6161

6262
julia_script = f"""
6363
{parse_config_code}
@@ -105,7 +105,7 @@ def test_parallel_parametrization_over_source_file_w_loop(
105105
def task_execute_julia_script(produces=Path(f"{{i}}.csv")):
106106
pass
107107
"""
108-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
108+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
109109

110110
julia_script = f"""
111111
{parse_config_code}

tests/test_parametrize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_parametrized_execution_of_jl_script_w_loop(
3939
def task_run_jl_script(produces=Path(f"{{i}}.txt")):
4040
pass
4141
"""
42-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
42+
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source))
4343

4444
for name in ("script_1.jl", "script_2.jl"):
4545
julia_script = f"""

0 commit comments

Comments
 (0)