From f13d8243175117e550b214ecd44e23a3505de733 Mon Sep 17 00:00:00 2001 From: Alex Bird Date: Thu, 2 Oct 2025 16:06:39 -0700 Subject: [PATCH] Update ellens-alien-game test to prevent returning an empty list from the factory Before this change, you can pass the tests for `new_aliens_collection` by returning an empty list. After this change, the returned list must have the same length as the input list (so you create the same number of Aliens as the input asks for). --- exercises/concept/ellens-alien-game/classes_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exercises/concept/ellens-alien-game/classes_test.py b/exercises/concept/ellens-alien-game/classes_test.py index 3d2b986be4..0d347734b0 100644 --- a/exercises/concept/ellens-alien-game/classes_test.py +++ b/exercises/concept/ellens-alien-game/classes_test.py @@ -199,6 +199,9 @@ def test_new_aliens_collection(self): test_data = [(-2, 6), (1, 5), (-4, -3)] actual_result = new_aliens_collection(test_data) + length_error_message = f"Expected {len(test_data)} Aliens, got {len(actual_result)}" + self.assertEqual(len(actual_result), len(test_data), msg=length_error_message) + error_message = "new_aliens_collection() must return a list of Alien objects." for obj in actual_result: