Browse Source

PersonCollection.get_children: deterministic doctest

Fabian Peter Hammerle 4 years ago
parent
commit
f3e6feab4f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      yamily/__init__.py

+ 4 - 4
yamily/__init__.py

@@ -201,8 +201,8 @@ class PersonCollection:
         >>> carol.father = c['bob']
         >>> c.add_person(carol)
         Person(carol)
-        >>> c.get_children('bob')
-        {Person(carol), Person(alice)}
+        >>> sorted(c.get_children('bob'), key=lambda p: p.identifier)
+        [Person(alice), Person(carol)]
 
         does not support change / removal of parents:
         >>> carol.father = Person('other-bob')
@@ -210,8 +210,8 @@ class PersonCollection:
         Person(carol)
         >>> c.get_children('other-bob')
         {Person(carol)}
-        >>> c.get_children('bob')
-        {Person(carol), Person(alice)}
+        >>> sorted(c.get_children('bob'), key=lambda p: p.identifier)
+        [Person(alice), Person(carol)]
         """
         if isinstance(parent, str):
             return self.__children[parent]