From fb26a66ab179fe375f50933c2be3f2e5da2f68a3 Mon Sep 17 00:00:00 2001 From: Hazel Seanor Date: Tue, 24 Oct 2017 14:44:48 +0100 Subject: [PATCH 1/2] Swap '2016' for '1996' to stop faulty logic from passing unit test [This leap solution](http://exercism.io/submissions/7ef5b0ab93b540f79cdee9f153e0a21c) should not pass the unit test, since it checks whether `year % 100` and `year % 400` are equal in order to tell whether the year it has been passed is a leap year. This works for 2016 because `2016 % 100` and `2016 % 400` both evaluate to 16. 1996, another leap year that is divisible by 4 but not 100, does not have this property and, under that solution, would falsely not be classed as a leap year. --- exercises/leap/leap_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/leap/leap_test.py b/exercises/leap/leap_test.py index 1936a1a136..5b21149d9d 100644 --- a/exercises/leap/leap_test.py +++ b/exercises/leap/leap_test.py @@ -10,7 +10,7 @@ def test_year_not_divisible_by_4(self): self.assertIs(is_leap_year(2015), False) def test_year_divisible_by_4_not_divisible_by_100(self): - self.assertIs(is_leap_year(2016), True) + self.assertIs(is_leap_year(1996), True) def test_year_divisible_by_100_not_divisible_by_400(self): self.assertIs(is_leap_year(2100), False) From 19351fe149403d87e7d128fb31a878ea7c342789 Mon Sep 17 00:00:00 2001 From: Hazel Seanor Date: Tue, 24 Oct 2017 17:14:04 +0100 Subject: [PATCH 2/2] Changed version number --- exercises/leap/leap_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/leap/leap_test.py b/exercises/leap/leap_test.py index 5b21149d9d..68cd970057 100644 --- a/exercises/leap/leap_test.py +++ b/exercises/leap/leap_test.py @@ -3,7 +3,7 @@ from leap import is_leap_year -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 class YearTest(unittest.TestCase): def test_year_not_divisible_by_4(self):