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
15 changes: 10 additions & 5 deletions exercises/alphametics/.meta/template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
class {{ exercise | camel_case }}Test(unittest.TestCase):
{% for case in cases[0]["cases"] -%}
{% set description = case["description"] | to_snake -%}
{% set testdef = "def test_" ~ description ~ "(self):" -%}
{% set value = case["input"]["puzzle"] -%}
{% if value|length > 100 -%}
# Reason to skip this test at https://github.com/exercism/python/pull/1358
{% set long_test = value|length > 100 -%}
{% if long_test -%}
# See https://github.com/exercism/python/pull/1358
@unittest.skip("extra-credit")
{% endif %}
def test_{{ description }}(self):
{{ testdef }}
"""This test may take a long time to run. Please be patient when running it."""
{%- else %}
{{ testdef }}
{%- endif %}
{% set expected = case["expected"] -%}
{% if value|length > 100 -%}
{% if long_test -%}
{% for line in value | wrap_overlong(width=62) -%}
{% if loop.index == 1 -%}
puzzle = {{ line }}
Expand Down
3 changes: 2 additions & 1 deletion exercises/alphametics/alphametics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ def test_puzzle_with_ten_letters(self):
},
)

# Reason to skip this test at https://github.com/exercism/python/pull/1358
# See https://github.com/exercism/python/pull/1358
@unittest.skip("extra-credit")
def test_puzzle_with_ten_letters_and_199_addends(self):
"""This test may take a long time to run. Please be patient when running it."""
puzzle = (
"THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL"
"+ A + TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE +"
Expand Down