Skip to content

Commit da481fe

Browse files
cmccandlessyawpitch
authored andcommitted
alphametics: improve comments on extra-credit test (#2126)
* alphametics: improve comments on extra-credit test * update template * use cached condition
1 parent 53cef5b commit da481fe

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

exercises/alphametics/.meta/template.j2

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
class {{ exercise | camel_case }}Test(unittest.TestCase):
55
{% for case in cases[0]["cases"] -%}
66
{% set description = case["description"] | to_snake -%}
7+
{% set testdef = "def test_" ~ description ~ "(self):" -%}
78
{% set value = case["input"]["puzzle"] -%}
8-
{% if value|length > 100 -%}
9-
# Reason to skip this test at https://github.com/exercism/python/pull/1358
9+
{% set long_test = value|length > 100 -%}
10+
{% if long_test -%}
11+
# See https://github.com/exercism/python/pull/1358
1012
@unittest.skip("extra-credit")
11-
{% endif %}
12-
def test_{{ description }}(self):
13+
{{ testdef }}
14+
"""This test may take a long time to run. Please be patient when running it."""
15+
{%- else %}
16+
{{ testdef }}
17+
{%- endif %}
1318
{% set expected = case["expected"] -%}
14-
{% if value|length > 100 -%}
19+
{% if long_test -%}
1520
{% for line in value | wrap_overlong(width=62) -%}
1621
{% if loop.index == 1 -%}
1722
puzzle = {{ line }}

exercises/alphametics/alphametics_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ def test_puzzle_with_ten_letters(self):
5959
},
6060
)
6161

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

0 commit comments

Comments
 (0)