diff --git a/src/individual.py b/src/individual.py index 3d61b46..ca71f44 100644 --- a/src/individual.py +++ b/src/individual.py @@ -211,9 +211,10 @@ class Individual: - children: List of Individual objects """ families = [] + # Cache the subject pointer once; it doesn't change across families. + self_pointer = self.element.get_pointer() for family in self.gedcom.get_families(self.element): # Get partner - self_pointer = self.element.get_pointer() partners = [ Individual(parent, self.gedcom) for parent in self.gedcom.get_family_members(family, "PARENTS") diff --git a/tests/test_individual.py b/tests/test_individual.py index ea8cb73..992ae52 100644 --- a/tests/test_individual.py +++ b/tests/test_individual.py @@ -17,26 +17,6 @@ from gedcom_parser import GedcomParser from individual import Individual -class TestIndividualBasicInfo: - """Tests for basic individual information extraction.""" - - @pytest.fixture - def john_doe(self, sample_gedcom_file): - """Get the John Doe individual from sample GEDCOM.""" - parser = GedcomParser(sample_gedcom_file) - individuals = parser.get_individuals() - """ -Tests for the Individual data model. - -This module tests individual person data extraction including: -- Names and IDs -- Birth and death information -- Events and attributes -- Family relationships -- Images and notes -- Custom story tags -""" - class TestIndividualBasicInfo: """Tests for basic individual information extraction.""" @@ -350,10 +330,6 @@ class TestEvents: events = person.get_events() event_types = [e['type'] for e in events] - assert resi['place'] == 'Deepplace' - assert resi['lat'] == '48.8566' - assert resi['long'] == '2.3522' - class TestFamilyRelationships: """Tests for family relationship extraction.""" @@ -601,8 +577,6 @@ class TestAttributes: attrs = person.get_attributes() assert len(attrs) == 0 - return Individual(john[0], parser.parser) - def test_get_id(self, john_doe): """Test ID extraction without @ symbols.""" id_value = john_doe.get_id()