summaryrefslogtreecommitdiff
path: root/docutils/test/test_error_reporting.py
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-08-26 12:09:42 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-08-26 12:09:42 +0000
commitfae91e45bdcf42592d78ae0f8035b94fa6dda70c (patch)
treec877c672a8123662a1dcce1e6ac84fa36a588407 /docutils/test/test_error_reporting.py
parent08af9b25a2e33f4c70bda60caa8a8ac53a36ee86 (diff)
downloaddocutils-fae91e45bdcf42592d78ae0f8035b94fa6dda70c.tar.gz
Drop support for Python 3.3
This doesn't involve a whole lot of changes, but references to Python 3.3 (plus some to the already removed Python 2.6) are removed and 'setup.py' is updated as necessary. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8338 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/test_error_reporting.py')
-rw-r--r--docutils/test/test_error_reporting.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py
index 845927ca7..d62e6dbad 100644
--- a/docutils/test/test_error_reporting.py
+++ b/docutils/test/test_error_reporting.py
@@ -27,7 +27,6 @@ unless the minimal required Python version has this problem fixed.
import unittest
import sys, os
-import codecs
from io import StringIO, BytesIO
import DocutilsTestSupport # must be imported before docutils
@@ -35,15 +34,13 @@ from docutils import core, parsers, frontend, utils
from docutils.utils.error_reporting import SafeString, ErrorString, ErrorOutput
oldlocale = None
-if sys.version_info < (3,0): # problems solved in py3k
+if sys.version_info < (3, 0): # problems solved in py3k
try:
- import locale # module missing in Jython
+ import locale # module missing in Jython
oldlocale = locale.getlocale()
- # Why does getlocale return the defaultlocale in Python 3.2 ????
- # oldlocale = (None, None) # test suite runs without locale
except ImportError:
print ('cannot test error reporting with problematic locales,\n'
- '`import locale` failed.')
+ '`import locale` failed.')
# locales confirmed to use non-ASCII chars in the IOError message
@@ -81,8 +78,6 @@ class SafeStringTests(unittest.TestCase):
us = u'\xfc' # bytes(us) fails; str(us) fails in Python 2
be = Exception(bs) # unicode(be) fails
ue = Exception(us) # bytes(ue) fails, str(ue) fails in Python 2;
- # unicode(ue) fails in Python < 2.6 (issue2517_)
- # .. _issue2517: http://bugs.python.org/issue2517
# wrapped test data:
wbs = SafeString(bs)
wus = SafeString(us)
@@ -114,7 +109,7 @@ class SafeStringTests(unittest.TestCase):
self.assertEqual(unicode(self.us), unicode(self.wus))
# unicode(self.be) fails
self.assertEqual(unicode, type(unicode(self.wbe)))
- # unicode(ue) fails in Python < 2.6 (issue2517_)
+ self.assertEqual(unicode, type(unicode(self.ue)))
self.assertEqual(unicode, type(unicode(self.wue)))
self.assertEqual(self.us, unicode(self.wue))