Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def textwrap_body(body, *, subsequent_indent=''):
# step 2: break into paragraphs and wrap those
paragraphs = text.split("\n\n")
paragraphs2 = []
kwargs = {}
kwargs = {'break_long_words': False, 'break_on_hyphens': False}
if subsequent_indent:
kwargs['subsequent_indent'] = subsequent_indent
dont_reflow = False
Expand Down Expand Up @@ -655,11 +655,18 @@ def filename_test(self, filename):
b = Blurbs()
b.load(filename)
self.assertTrue(b)
if os.path.exists(filename + '.res'):
with open(filename + '.res', encoding='utf-8') as f:
expected = f.read()
self.assertEqual(str(b), expected)

def test_files(self):
global tests_run
with pushd(self.directory):
for filename in glob.glob("*"):
if filename[-4:] == '.res':
self.assertTrue(os.path.exists(filename[:-4]), filename)
continue
self.filename_test(filename)
print(".", end="")
sys.stdout.flush()
Expand Down
6 changes: 6 additions & 0 deletions blurb/tests/pass/no-break-long-words.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. bpo: 0
.. date: 1234
.. nonce: xyz
.. section: Library

0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
6 changes: 6 additions & 0 deletions blurb/tests/pass/no-break-long-words.rst.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. bpo: 0
.. date: 1234
.. nonce: xyz
.. section: Library

0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
6 changes: 6 additions & 0 deletions blurb/tests/pass/no-break-on-hyphens.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. bpo: 21121
.. date: 7333
.. nonce: ZLsRil
.. section: Library

Don't force 3rd party C extensions to be built with ``-Werror=declaration-after-statement``.
7 changes: 7 additions & 0 deletions blurb/tests/pass/no-break-on-hyphens.rst.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. bpo: 21121
.. date: 7333
.. nonce: ZLsRil
.. section: Library

Don't force 3rd party C extensions to be built with
``-Werror=declaration-after-statement``.