diff --git a/gramps/plugins/test/tools_test.py b/gramps/plugins/test/tools_test.py index f41c152f7..a861071c5 100644 --- a/gramps/plugins/test/tools_test.py +++ b/gramps/plugins/test/tools_test.py @@ -145,8 +145,8 @@ class ToolControl(unittest.TestCase): "1 invalid birth event name was fixed", "1 invalid death event name was fixed", "2 places were referenced, but not found", - "14 citations were referenced, but not found", - "17 sources were referenced, but not found", + "15 citations were referenced, but not found", + "18 sources were referenced, but not found", "9 Duplicated Gramps IDs fixed", "7 empty objects removed", "1 person objects", diff --git a/gramps/plugins/tool/testcasegenerator.py b/gramps/plugins/tool/testcasegenerator.py index 20e615cd5..e742283ff 100644 --- a/gramps/plugins/tool/testcasegenerator.py +++ b/gramps/plugins/tool/testcasegenerator.py @@ -1998,7 +1998,8 @@ class TestcaseGenerator(tool.BatchTool): # if _randint(0, 1) == 1: # (year, dat) = self.rand_date( ) # obj.set_date_object( dat) - obj.set_confidence_level(_choice(list(conf_strings.keys()))) + # sort to provide deterministic output in unit tests + obj.set_confidence_level(_choice(sorted(conf_strings.keys()))) if issubclass(obj.__class__, TagBase): if _randint(0, 1) == 1: @@ -2053,7 +2054,8 @@ class TestcaseGenerator(tool.BatchTool): def rand_type(self, gtype): if issubclass(gtype.__class__, GrampsType): gmap = gtype.get_map() - key = _choice(list(gmap.keys())) + # sort to provide deterministic output in unit tests + key = _choice(sorted(gmap.keys())) if key == gtype.get_custom(): value = self.rand_text(self.SHORT) else: