summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-04-01 01:42:07 +0000
committerwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-04-01 01:42:07 +0000
commit8a4652e236fc404d10f9334b5ecb69ea0aa362ed (patch)
treeb5173edbba5ae9fcf2791fe34af3a3362821c289
parentf14fa3120d94cf7de1eafca52bc002ae1fff6698 (diff)
downloaddocutils-8a4652e236fc404d10f9334b5ecb69ea0aa362ed.tar.gz
--- MERGE: merged r4439 to maintenance branch; original log message:
extracted over-complicated expression git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/docutils-0.4@4483 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rwxr-xr-xtest/test_parsers/test_rst/test_directives/test_unicode.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test_parsers/test_rst/test_directives/test_unicode.py b/test/test_parsers/test_rst/test_directives/test_unicode.py
index bd028cf42..f14dddc0f 100755
--- a/test/test_parsers/test_rst/test_directives/test_unicode.py
+++ b/test/test_parsers/test_rst/test_directives/test_unicode.py
@@ -18,6 +18,13 @@ def suite():
s.generateTests(totest)
return s
+unichr_exception = DocutilsTestSupport.exception_data(
+ 'unichr(int("111111111111111111", 16))')[0]
+if isinstance(unichr_exception, OverflowError):
+ unichr_exception_string = 'code too large (%s)' % unichr_exception
+else:
+ unichr_exception_string = str(unichr_exception)
+
totest = {}
totest['unicode'] = [
@@ -157,12 +164,7 @@ u"""\
Substitution definition "too big for unicode" empty or invalid.
<literal_block xml:space="preserve">
.. |too big for unicode| unicode:: 0x11111111
-""" % ([DocutilsTestSupport.exception_data(
- 'unichr(int("111111111111111111", 16))')[0],
- 'code too large (%s)' % DocutilsTestSupport.exception_data(
- 'unichr(int("111111111111111111", 16))')[0]]
- [isinstance(DocutilsTestSupport.exception_data(
- 'unichr(int("111111111111111111", 16))')[0], OverflowError)],
+""" % (unichr_exception_string,
DocutilsTestSupport.exception_data('unichr(int("11111111", 16))')[2])]
]