Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
releases are available on [PyPI](https://pypi.org/project/pytask-stata) and
[Anaconda.org](https://anaconda.org/conda-forge/pytask-stata).

## 0.4.0 - 2023-10-08
## 0.4.1 - 2024-xx-xx

- {pull}`37` updates the CI.
- {pull}`38` updates tests for pytask v0.5.

## 0.4.0 - 2024-03-19

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

Expand Down
13 changes: 7 additions & 6 deletions tests/test_normal_execution_w_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@
@pytest.mark.end_to_end()
@pytest.mark.parametrize(
"dependencies",
[[], ["in.txt"], ["in_1.txt", "in_2.txt"]],
[(), ("in.txt",), ("in_1.txt", "in_2.txt")],
)
@pytest.mark.parametrize("products", [["out.txt"], ["out_1.txt", "out_2.txt"]])
@pytest.mark.parametrize("products", [("out.txt",), ("out_1.txt", "out_2.txt")])
def test_execution_w_varying_dependencies_products(
runner, tmp_path, dependencies, products
):
source = f"""
import pytask
from pathlib import Path

@pytask.mark.depends_on({dependencies})
@pytask.mark.produces({products})
def task_example(depends_on, produces):
def task_example(
depends_on=[Path(p) for p in {dependencies}],
produces=[Path(p) for p in {products}],
):
if isinstance(produces, dict):
produces = produces.values()
elif isinstance(produces, Path):
produces = [produces]
for product in produces:
product.touch()
"""
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
for dependency in dependencies:
tmp_path.joinpath(dependency).touch()

Expand Down