Преглед на файлове

PersonCollection.get_children: deterministic doctest

Fabian Peter Hammerle преди 4 години
родител
ревизия
f3e6feab4f
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  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]