Skip to content

Commit

Permalink
use ordereddict for predictable output
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed May 30, 2018
1 parent 0a202af commit 7196fab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/towncrier/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def split_fragments(fragments, definitions):
if definitions[category]["showcontent"] is False:
content = u""

texts = section.get(category, {})
texts = section.get(category, OrderedDict())

if texts.get(content):
texts[content] = sorted(texts[content] + [ticket])
Expand Down
16 changes: 8 additions & 8 deletions src/towncrier/test/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class WritingTests(TestCase):
def test_append_at_top(self):

fragments = OrderedDict([
("", {
("142", "misc", 0): u"",
("1", "misc", 0): u"",
("4", "feature", 0): u"Stuff!",
("4", "feature", 1): u"Second Stuff!",
("2", "feature", 0): u"Foo added.",
("72", "feature", 0): u"Foo added.",
}),
("", OrderedDict([
(("142", "misc", 0), u""),
(("1", "misc", 0), u""),
(("4", "feature", 0), u"Stuff!"),
(("4", "feature", 1), u"Second Stuff!"),
(("2", "feature", 0), u"Foo added."),
(("72", "feature", 0), u"Foo added."),
])),
("Names", {}),
("Web", {
("3", "bugfix", 0): u"Web fixed.",
Expand Down

0 comments on commit 7196fab

Please sign in to comment.