From 154703d21c9609c8d45f3a7997dab575c2bc6983 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Wed, 5 Jun 2019 11:49:18 +0000 Subject: [PATCH] [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) --- odoo/modules/module.py | 7 +------ odoo/tests/common.py | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 9160717bfb9..8036bff7dd9 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -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 diff --git a/odoo/tests/common.py b/odoo/tests/common.py index d84673d76fb..90655bd24b6 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -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):