From 29f7aeeaa5dbd9baf60162d21553d9dc41e83717 Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Wed, 15 Jul 2026 17:38:49 +0530 Subject: [PATCH 1/2] Fix test order in Raindrops exercise Added numeric prefixes to test method names to ensure tests run in the defined order instead of alphabetical order. Updated the template.j2 to generate tests with numeric prefixes. Fixes exercism/python#2214 --- .../practice/raindrops/.meta/template.j2 | 2 +- .../practice/raindrops/raindrops_test.py | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/exercises/practice/raindrops/.meta/template.j2 b/exercises/practice/raindrops/.meta/template.j2 index c84975c9bbb..0cf45b70160 100644 --- a/exercises/practice/raindrops/.meta/template.j2 +++ b/exercises/practice/raindrops/.meta/template.j2 @@ -13,7 +13,7 @@ class {{ exercise | camel_case }}Test(unittest.TestCase): {% for case in cases -%} - def test_{{ case["description"] | to_snake }}(self): + def test_{{ "%02d" | format(loop.index) }}_{{ case["description"] | to_snake }}(self): self.assertEqual( {{- test_call(case) }}, "{{ case["expected"] }}" diff --git a/exercises/practice/raindrops/raindrops_test.py b/exercises/practice/raindrops/raindrops_test.py index b07e70dc24a..55e62f3e958 100644 --- a/exercises/practice/raindrops/raindrops_test.py +++ b/exercises/practice/raindrops/raindrops_test.py @@ -10,58 +10,58 @@ class RaindropsTest(unittest.TestCase): - def test_the_sound_for_1_is_1(self): + def test_01_the_sound_for_1_is_1(self): self.assertEqual(convert(1), "1") - def test_the_sound_for_3_is_pling(self): + def test_02_the_sound_for_3_is_pling(self): self.assertEqual(convert(3), "Pling") - def test_the_sound_for_5_is_plang(self): + def test_03_the_sound_for_5_is_plang(self): self.assertEqual(convert(5), "Plang") - def test_the_sound_for_7_is_plong(self): + def test_04_the_sound_for_7_is_plong(self): self.assertEqual(convert(7), "Plong") - def test_the_sound_for_6_is_pling_as_it_has_a_factor_3(self): + def test_05_the_sound_for_6_is_pling_as_it_has_a_factor_3(self): self.assertEqual(convert(6), "Pling") - def test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base( + def test_06_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base( self, ): self.assertEqual(convert(8), "8") - def test_the_sound_for_9_is_pling_as_it_has_a_factor_3(self): + def test_07_the_sound_for_9_is_pling_as_it_has_a_factor_3(self): self.assertEqual(convert(9), "Pling") - def test_the_sound_for_10_is_plang_as_it_has_a_factor_5(self): + def test_08_the_sound_for_10_is_plang_as_it_has_a_factor_5(self): self.assertEqual(convert(10), "Plang") - def test_the_sound_for_14_is_plong_as_it_has_a_factor_of_7(self): + def test_09_the_sound_for_14_is_plong_as_it_has_a_factor_of_7(self): self.assertEqual(convert(14), "Plong") - def test_the_sound_for_15_is_pling_plang_as_it_has_factors_3_and_5(self): + def test_10_the_sound_for_15_is_pling_plang_as_it_has_factors_3_and_5(self): self.assertEqual(convert(15), "PlingPlang") - def test_the_sound_for_21_is_pling_plong_as_it_has_factors_3_and_7(self): + def test_11_the_sound_for_21_is_pling_plong_as_it_has_factors_3_and_7(self): self.assertEqual(convert(21), "PlingPlong") - def test_the_sound_for_25_is_plang_as_it_has_a_factor_5(self): + def test_12_the_sound_for_25_is_plang_as_it_has_a_factor_5(self): self.assertEqual(convert(25), "Plang") - def test_the_sound_for_27_is_pling_as_it_has_a_factor_3(self): + def test_13_the_sound_for_27_is_pling_as_it_has_a_factor_3(self): self.assertEqual(convert(27), "Pling") - def test_the_sound_for_35_is_plang_plong_as_it_has_factors_5_and_7(self): + def test_14_the_sound_for_35_is_plang_plong_as_it_has_factors_5_and_7(self): self.assertEqual(convert(35), "PlangPlong") - def test_the_sound_for_49_is_plong_as_it_has_a_factor_7(self): + def test_15_the_sound_for_49_is_plong_as_it_has_a_factor_7(self): self.assertEqual(convert(49), "Plong") - def test_the_sound_for_52_is_52(self): + def test_16_the_sound_for_52_is_52(self): self.assertEqual(convert(52), "52") - def test_the_sound_for_105_is_pling_plang_plong_as_it_has_factors_3_5_and_7(self): + def test_17_the_sound_for_105_is_pling_plang_plong_as_it_has_factors_3_5_and_7(self): self.assertEqual(convert(105), "PlingPlangPlong") - def test_the_sound_for_3125_is_plang_as_it_has_a_factor_5(self): + def test_18_the_sound_for_3125_is_plang_as_it_has_a_factor_5(self): self.assertEqual(convert(3125), "Plang") From 07c2e238dd1c4a398d8f629a090273e61fd8497d Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Wed, 15 Jul 2026 17:41:23 +0530 Subject: [PATCH 2/2] Update CONTRIBUTING.md to use configlet sync instead of generate Updated the 'Generating Practice Exercise Documents' section to reflect the new configlet sync command which replaces the deprecated generate command. Fixes exercism/python#2680 --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ff557f7087..42c1d2ec46a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -368,13 +368,13 @@ Implementing Track-specific Practice Exercises is similar to implementing a `can

For Individual Exercises

```bash -configlet generate --spec-path path/to/problem/specifications --only example-exercise +configlet sync --docs --filepaths --metadata --exercise example-exercise -u -y --spec-path path/to/problem/specifications ```

For all Practice Exercises

```bash -configlet generate --spec-path path/to/problem/specifications +configlet sync --docs --filepaths --metadata -u -y --spec-path path/to/problem/specifications ```