Merge another unicode fix.
This commit is contained in:
9
NEWS
9
NEWS
@@ -4,6 +4,15 @@ testtools NEWS
|
|||||||
NEXT
|
NEXT
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
Improvements
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Martin[gz] fixed traceback handling to handle cases where extract_tb returns
|
||||||
|
a source line of None. Fixes bug #611307.
|
||||||
|
|
||||||
|
* Martin[gz] fixed an unicode issue that was causing the tests to fail,
|
||||||
|
closing bug #604187.
|
||||||
|
|
||||||
0.9.4
|
0.9.4
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,8 @@ def _format_exc_info(eclass, evalue, tb, limit=None):
|
|||||||
filename.decode(fs_enc, "replace"),
|
filename.decode(fs_enc, "replace"),
|
||||||
lineno,
|
lineno,
|
||||||
name.decode("ascii", "replace"),
|
name.decode("ascii", "replace"),
|
||||||
line.decode(_get_source_encoding(filename), "replace")))
|
line and line.decode(
|
||||||
|
_get_source_encoding(filename), "replace")))
|
||||||
list.extend(traceback.format_list(extracted_list))
|
list.extend(traceback.format_list(extracted_list))
|
||||||
else:
|
else:
|
||||||
list = []
|
list = []
|
||||||
|
|||||||
@@ -914,6 +914,13 @@ class TestNonAsciiResults(TestCase):
|
|||||||
textoutput = self._test_external_case("self.fail(%s)" % _r(raw))
|
textoutput = self._test_external_case("self.fail(%s)" % _r(raw))
|
||||||
self.assertIn(self._as_output(text), textoutput)
|
self.assertIn(self._as_output(text), textoutput)
|
||||||
|
|
||||||
|
def test_non_ascii_failure_string_via_exec(self):
|
||||||
|
"""Assertion via exec can be non-ascii and still gets decoded"""
|
||||||
|
text, raw = self._get_sample_text(_get_exception_encoding())
|
||||||
|
textoutput = self._test_external_case(
|
||||||
|
testline='exec ("self.fail(%s)")' % _r(raw))
|
||||||
|
self.assertIn(self._as_output(text), textoutput)
|
||||||
|
|
||||||
def test_control_characters_in_failure_string(self):
|
def test_control_characters_in_failure_string(self):
|
||||||
"""Control characters in assertions should be escaped"""
|
"""Control characters in assertions should be escaped"""
|
||||||
textoutput = self._test_external_case("self.fail('\\a\\a\\a')")
|
textoutput = self._test_external_case("self.fail('\\a\\a\\a')")
|
||||||
|
|||||||
Reference in New Issue
Block a user