summaryrefslogtreecommitdiff
path: root/docutils/test/DocutilsTestSupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
-rw-r--r--docutils/test/DocutilsTestSupport.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py
index 2901fc6e9..25783b5e0 100644
--- a/docutils/test/DocutilsTestSupport.py
+++ b/docutils/test/DocutilsTestSupport.py
@@ -789,43 +789,3 @@ def exception_data(func, *args, **kwds):
return (detail, detail.args,
'%s: %s' % (detail.__class__.__name__, detail))
return None, [], "No exception"
-
-
-def _format_str(*args):
- r"""
- Return a tuple containing representations of all args.
-
- Same as map(repr, args) except that it returns multi-line
- representations for strings containing newlines, e.g.::
-
- '''\
- foo \n\
- bar
-
- baz'''
-
- instead of::
-
- 'foo \nbar\n\nbaz'
-
- This is a helper function for CustomTestCase.
- """
- return_tuple = []
- for i in args:
- r = repr(i)
- if isinstance(i, (str, bytes)) and '\n' in i:
- stripped = ''
- if isinstance(i, bytes) and r.startswith('b'):
- stripped = r[0]
- r = r[1:]
- # quote_char = "'" or '"'
- quote_char = r[0]
- assert quote_char in ("'", '"'), quote_char
- assert r[0] == r[-1]
- r = r[1:-1]
- r = (stripped + 3*quote_char + '\\\n'
- + re.sub(r'(?<!\\)((\\\\)*)\\n', r'\1\n', r)
- + 3*quote_char)
- r = re.sub(r' \n', r' \\n\\\n', r)
- return_tuple.append(r)
- return tuple(return_tuple)