From e0b4fa520caffd5f9e7625885d77726a7f98818c Mon Sep 17 00:00:00 2001 From: Brian Kohan Date: Wed, 4 Mar 2026 22:56:28 -0800 Subject: [PATCH 1/2] fix coverage for line 526 --- tests/test_functional.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_functional.py b/tests/test_functional.py index 889391b..b9e5c4e 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -385,6 +385,11 @@ def test_names_as_empty_list(self): AnEnum = EnumProperties("AnEnum", [], properties=("label",)) self.assertEqual(list(AnEnum), []) + def test_names_as_empty_generator(self): + """Empty generator produces an enum with no members.""" + AnEnum = EnumProperties("AnEnum", (x for x in []), properties=("label",)) + self.assertEqual(list(AnEnum), []) + def test_names_as_plain_list_of_strings(self): """List of plain strings auto-assigns sequential start values (line 508).""" AnEnum = EnumProperties("AnEnum", ["X", "Y", "Z"], start=10) From cce8df33b015a5f10ff595e3d3bfd3afba020e79 Mon Sep 17 00:00:00 2001 From: Brian Kohan Date: Wed, 4 Mar 2026 23:01:52 -0800 Subject: [PATCH 2/2] add test coverage for non-symmetric name annotation --- tests/annotations/test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/annotations/test.py b/tests/annotations/test.py index 66cad91..9b85b4b 100644 --- a/tests/annotations/test.py +++ b/tests/annotations/test.py @@ -984,3 +984,17 @@ def _generate_next_value_(name, start, count, last_values) -> str: self.assertEqual(ColorAutoOverride.ONE.spanish, "Uno") self.assertEqual(ColorAutoOverride.TWO.spanish, "Dos") self.assertEqual(ColorAutoOverride.THREE.spanish, "Tres") + + def test_name_annotation_plain_non_symmetric(self): + """Annotating 'name' without Symmetric is silently ignored (line 630->644).""" + + class MyEnum(EnumProperties): + name: str # plain (non-symmetric) — hits the issubclass(prop, _SProp) False branch + label: str + + A = "a", "alpha" + B = "b", "beta" + + # 'name' behavior is unchanged: still case-sensitive symmetric by default + self.assertIs(MyEnum("A"), MyEnum.A) + self.assertEqual(MyEnum.A.label, "alpha")