diff --git a/snakemake/parser.py b/snakemake/parser.py index 514d39398..90628c5de 100644 --- a/snakemake/parser.py +++ b/snakemake/parser.py @@ -1129,7 +1129,7 @@ def block_content(self, token): ) except StopAutomaton as e: self.indentation(e.token) - self.block(e.token) + yield from self.block(e.token) else: self.error( "Expecting a keyword or comment " diff --git a/tests/test_github_issue1618/Snakefile b/tests/test_github_issue1618/Snakefile new file mode 100644 index 000000000..84a63d2af --- /dev/null +++ b/tests/test_github_issue1618/Snakefile @@ -0,0 +1,19 @@ +rule all: + input: + "test2.out", + + +rule a: + output: + "test.out", + threads: 4 + shell: + """ + echo {threads} > {output} + """ + + +use rule a as b with: + threads: 5 + output: + "test2.out", diff --git a/tests/test_github_issue1618/expected-results/test2.out b/tests/test_github_issue1618/expected-results/test2.out new file mode 100644 index 000000000..7ed6ff82d --- /dev/null +++ b/tests/test_github_issue1618/expected-results/test2.out @@ -0,0 +1 @@ +5 diff --git a/tests/tests.py b/tests/tests.py index 204ed4fea..45b56a62b 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1644,3 +1644,8 @@ def test_rule_inheritance_globals(): def test_retries(): run(dpath("test_retries")) + + +@skip_on_windows # sufficient to test this on linux +def test_github_issue1618(): + run(dpath("test_github_issue1618"), cores=5)