Skip to content

Commit fd38898

Browse files
authored
Update tests for pytask v0.5. (#38)
1 parent 612aca3 commit fd38898

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

CHANGES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask-stata) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask-stata).
77

8-
## 0.4.0 - 2023-10-08
8+
## 0.4.1 - 2024-xx-xx
9+
10+
- {pull}`37` updates the CI.
11+
- {pull}`38` updates tests for pytask v0.5.
12+
13+
## 0.4.0 - 2024-03-19
914

1015
- {pull}`36` makes pytask-stata compatible with pytask v0.4.0.
1116

tests/test_normal_execution_w_plugin.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,28 @@
1212
@pytest.mark.end_to_end()
1313
@pytest.mark.parametrize(
1414
"dependencies",
15-
[[], ["in.txt"], ["in_1.txt", "in_2.txt"]],
15+
[(), ("in.txt",), ("in_1.txt", "in_2.txt")],
1616
)
17-
@pytest.mark.parametrize("products", [["out.txt"], ["out_1.txt", "out_2.txt"]])
17+
@pytest.mark.parametrize("products", [("out.txt",), ("out_1.txt", "out_2.txt")])
1818
def test_execution_w_varying_dependencies_products(
1919
runner, tmp_path, dependencies, products
2020
):
2121
source = f"""
2222
import pytask
2323
from pathlib import Path
2424
25-
@pytask.mark.depends_on({dependencies})
26-
@pytask.mark.produces({products})
27-
def task_example(depends_on, produces):
25+
def task_example(
26+
depends_on=[Path(p) for p in {dependencies}],
27+
produces=[Path(p) for p in {products}],
28+
):
2829
if isinstance(produces, dict):
2930
produces = produces.values()
3031
elif isinstance(produces, Path):
3132
produces = [produces]
3233
for product in produces:
3334
product.touch()
3435
"""
35-
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
36+
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
3637
for dependency in dependencies:
3738
tmp_path.joinpath(dependency).touch()
3839

0 commit comments

Comments
 (0)