Commit c7fbe926 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 5d8f8d53
......@@ -65,7 +65,8 @@ class DCommand(Command):
def _uncompleted_children(self, p_todo):
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, p_print_numbers=True):
......
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