summaryrefslogtreecommitdiff
path: root/docutils/test
diff options
context:
space:
mode:
authoraa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-10-21 01:41:15 +0000
committeraa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-10-21 01:41:15 +0000
commit0c5bb4bb48fcfc46091ca8e823b2bfccc47678bd (patch)
tree6b94af24ec396991bcef3f8706b9ae9ade97c6a6 /docutils/test
parent0e5961a098f35bc466896502886ba2d96690f971 (diff)
downloaddocutils-0c5bb4bb48fcfc46091ca8e823b2bfccc47678bd.tar.gz
Remove now unused ``_format_str`` function
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9145 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
-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)