Commit 8f1153a0 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Sort child todo items deterministically.

sorted() was run on a list of Todo objects, which may produce different
results. Instead, sort on the item's number (i.e. its index in the
TodoList).

This should fix the occasional failing of test_do_subtasks2.
parent a5e3a9e7
...@@ -65,7 +65,8 @@ class DCommand(Command): ...@@ -65,7 +65,8 @@ class DCommand(Command):
def _uncompleted_children(self, p_todo): def _uncompleted_children(self, p_todo):
return sorted( return sorted(
[t for t in self.todolist.children(p_todo) if not t.is_completed()] [t for t in self.todolist.children(p_todo) if not t.is_completed()],
key=self.todolist.number
) )
def _print_list(self, p_todos): def _print_list(self, p_todos):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment