title_format overrides default top line#276
Conversation
Codecov Report
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
+ Coverage 95.57% 95.86% +0.29%
==========================================
Files 20 20
Lines 1085 1089 +4
Branches 105 104 -1
==========================================
+ Hits 1037 1044 +7
+ Misses 27 25 -2
+ Partials 21 20 -1
Continue to review full report at Codecov.
|
adiroiban
left a comment
There was a problem hiding this comment.
All good. Thanks. Only minor comments.
src/towncrier/test/test_format.py
Outdated
|
|
||
| definitions = OrderedDict() | ||
|
|
||
| expected_output = u"""A custom top line |
There was a problem hiding this comment.
to make the code a bit easier to read I would prefer to have the expect_outpupt" define just before the call to self.assertEqual(output, expected_output)`
src/towncrier/test/test_format.py
Outdated
| output = render_fragments( | ||
| template, | ||
| None, | ||
| "A custom top line", |
There was a problem hiding this comment.
also. to make all these render_fragments easier to read, it woud be nice to call them with named arguments for all argumetns and not only
| output = render_fragments( | |
| template, | |
| None, | |
| "A custom top line", | |
| output = render_fragments( | |
| template=template, | |
| issue_format=None, | |
| top_line="A custom top line", |
src/towncrier/test/test_format.py
Outdated
|
|
||
| expected_output = u"""A custom top line | ||
| ================= | ||
| """ # NOQA |
There was a problem hiding this comment.
minor comment. Why do we need no qa here?
There was a problem hiding this comment.
I'm guessing it was the indentation? Switched to dedent().
src/towncrier/test/test_format.py
Outdated
| self.maxDiff = None | ||
|
|
||
| fragments = {} | ||
|
|
There was a problem hiding this comment.
I think that maxDiff ended up after a debugging session :)
| self.maxDiff = None | |
| fragments = {} |
src/towncrier/test/test_format.py
Outdated
| "towncrier", "templates/default.rst" | ||
| ).decode("utf8") | ||
|
|
||
| fragments = split_fragments(fragments, definitions) |
There was a problem hiding this comment.
Maybe use this ... in this way e have a hint that we don't care about fragments or definitions in this test and you don't need to look and see where and how they are created and how they are checked at the end.
| fragments = split_fragments(fragments, definitions) | |
| fragments = split_fragments(fragments={}, definitions=OrderedDict()) |
But for this tests it would be interesting to also have at least one definition and one fragment to increase the coverage and make it easy to compare the output for the case in which you run without a custom topline.
Fixes #180