[IMP] core: log traceback in one group

Traceback coming from tests are currently logged
line by line. This will implies that runbot will have one
ir_logging entry per line which is not practical. More than
that, the log prefix can make the traceback less readable
because of line returns and difficult to copy paste.

This commit simply remove this feature. After discussion with odo
and chs, we will also remove the docstring from test shortDescription
since most of the time this information is not clear and can be accessed
in source code if needed.

closes odoo/odoo#33911

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This commit is contained in:
Xavier-Do
2019-06-05 14:34:33 +00:00
parent 6d34a19ba8
commit 154703d21c
2 changed files with 2 additions and 8 deletions
+1 -6
View File
@@ -475,13 +475,8 @@ class TestStream(object):
def write(self, s):
if self.r.match(s):
return
first = True
level = logging.ERROR if s.startswith(('ERROR', 'FAIL', 'Traceback')) else logging.INFO
for c in s.splitlines():
if not first:
c = '` ' + c
first = False
self.logger.log(level, c)
self.logger.log(level, s)
current_test = None
+1 -2
View File
@@ -351,8 +351,7 @@ class BaseCase(TreeCase, MetaCase('DummyCase', (object,), {})):
self.fail(msg + _format_message(records, expected_values))
def shortDescription(self):
doc = self._testMethodDoc
return doc and ' '.join(l.strip() for l in doc.splitlines() if not l.isspace()) or None
return None
# turns out this thing may not be quite as useful as we thought...
def assertItemsEqual(self, a, b, msg=None):