Skip to content

Commit c532c85

Browse files
committed
Add test.
1 parent 547504b commit c532c85

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_parametrize.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,25 @@ def task_func():
408408
assert result.exit_code == ExitCode.COLLECTION_FAILED
409409
for c in content:
410410
assert c in result.output
411+
412+
413+
@pytest.mark.end_to_end
414+
def test_generators_are_removed_from_depends_on_produces(tmp_path):
415+
source = """
416+
from pathlib import Path
417+
import pytask
418+
419+
@pytask.mark.parametrize("produces", [
420+
((x for x in ["out.txt", "out_2.txt"]),),
421+
["in.txt"],
422+
])
423+
def task_example(produces):
424+
produces = {0: produces} if isinstance(produces, Path) else produces
425+
for p in produces.values():
426+
p.write_text("hihi")
427+
"""
428+
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
429+
430+
session = main({"paths": tmp_path})
431+
assert session.exit_code == 0
432+
assert session.tasks[0].function.__wrapped__.pytaskmark == []

0 commit comments

Comments
 (0)