mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
pycharm: unescape "\n" in expected/actual texts provided by test unit framework
This commit is contained in:
@@ -69,8 +69,10 @@ class TeamcityTestResult(TestResult):
|
||||
error_value = err[1][0]
|
||||
|
||||
if error_value.startswith("'") or error_value.startswith('"'):
|
||||
first = self.find_first(err[1][0])
|
||||
second = self.find_second(err[1][0])
|
||||
# let's unescape strings to show sexy multiline diff in PyCharm.
|
||||
# By default all caret return chars are escaped by testing framework
|
||||
first = self._unescape(self.find_first(err[1][0]))
|
||||
second = self._unescape(self.find_second(err[1][0]))
|
||||
else:
|
||||
first = second = ""
|
||||
err = self.formatErr(err)
|
||||
@@ -118,6 +120,9 @@ class TeamcityTestResult(TestResult):
|
||||
self.messages.testSuiteFinished(self.current_suite)
|
||||
self.current_suite = None
|
||||
|
||||
def _unescape(self, text):
|
||||
return text.decode('string_escape')
|
||||
|
||||
class TeamcityTestRunner:
|
||||
def __init__(self, stream=sys.stdout):
|
||||
self.stream = stream
|
||||
|
||||
Reference in New Issue
Block a user