Mercurial > public > mercurial-scm > hg-stable
diff tests/test-minirst.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | a2a5d4ad5276 |
children | aaff3bc75306 |
line wrap: on
line diff
--- a/tests/test-minirst.py Sat Oct 05 10:29:34 2019 -0400 +++ b/tests/test-minirst.py Sun Oct 06 09:45:02 2019 -0400 @@ -1,10 +1,7 @@ from __future__ import absolute_import, print_function -from mercurial import ( - minirst, -) -from mercurial.utils import ( - stringutil, -) +from mercurial import minirst +from mercurial.utils import stringutil + def debugformat(text, form, **kwargs): blocks, pruned = minirst.parse(text, **kwargs) @@ -23,12 +20,14 @@ print("-" * 70) print() + def debugformats(title, text, **kwargs): print("== %s ==" % title) debugformat(text, 60, **kwargs) debugformat(text, 30, **kwargs) debugformat(text, b'html', **kwargs) + paragraphs = b""" This is some text in the first paragraph. @@ -188,8 +187,9 @@ debugformats('containers (normal)', containers) debugformats('containers (verbose)', containers, keep=[b'verbose']) debugformats('containers (debug)', containers, keep=[b'debug']) -debugformats('containers (verbose debug)', containers, - keep=[b'verbose', b'debug']) +debugformats( + 'containers (verbose debug)', containers, keep=[b'verbose', b'debug'] +) roles = b"""Please see :hg:`add`.""" debugformats('roles', roles) @@ -245,9 +245,11 @@ debugformats('comments', comments) -data = [[b'a', b'b', b'c'], - [b'1', b'2', b'3'], - [b'foo', b'bar', b'baz this list is very very very long man']] +data = [ + [b'a', b'b', b'c'], + [b'1', b'2', b'3'], + [b'foo', b'bar', b'baz this list is very very very long man'], +] rst = minirst.maketable(data, 2, True) table = b''.join(rst) @@ -256,8 +258,10 @@ debugformats('table', table) -data = [[b's', b'long', b'line\ngoes on here'], - [b'', b'xy', b'tried to fix here\n by indenting']] +data = [ + [b's', b'long', b'line\ngoes on here'], + [b'', b'xy', b'tried to fix here\n by indenting'], +] rst = minirst.maketable(data, 1, False) table = b''.join(rst)