在 Mac OS X 的终端上。
assertEqual 的输出是
File "tests/test_conditions.py", line 27, in test_if_condition
self.assertEqual(result, expected)
AssertionError: ' if (self) {\n self.addMainLabel\n self.addSubLabel\n self.setupBackground\n }\n' != ' if self\n self.addMainLabel\n self.addSubLabel\n self.setupBackground\n end\n'
但是我想通过评估换行符'\n'并在'AssertionError:'之后添加换行符来获得以下输出。
File "tests/test_conditions.py", line 27, in test_if_condition
self.assertEqual(result, expected)
AssertionError:
' if (self) {
self.addMainLabel
self.addSubLabel
self.setupBackground
}
' !=
' if self
self.addMainLabel
self.addSubLabel
self.setupBackground
end
'