summaryrefslogtreecommitdiff
path: root/odoo/modules
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2019-08-27 08:33:21 +0000
committerChristophe Monniez <moc@odoo.com>2019-08-27 08:43:09 +0000
commit191213bca2582ed60c92769a8aa8a17cca0432e6 (patch)
tree49c733c6b7553e0498df762289fbc1c5f046baa9 /odoo/modules
parent8f4c8ef2dbd6daf7bf4640a392428b43ad5090d3 (diff)
[FIX] tests: avoid warning during a setUpClass failure
Since 735ee54 the logs are improved by getting additional informations from the traceback. When the test fails during the setUpClass, the test object received by the getCallerInfo method is not a TestCase instance but an _ErrorHolder. Although they should have the same API, as stated in unittest documentation, the _ErrorHolder does not have a _testMethodName attribute leading to a warning. With this commit, the warning is skipped in that particular case. closes odoo/odoo#36108 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Diffstat (limited to 'odoo/modules')
-rw-r--r--odoo/modules/module.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 220ea048943..61ebadeeb95 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -544,6 +544,8 @@ class OdooTestResult(unittest.result.TestResult):
"""
# only test case should be executed in odoo, this is only a safe guard
+ if isinstance(test, unittest.suite._ErrorHolder):
+ return
if not isinstance(test, unittest.TestCase):
_logger.warning('%r is not a TestCase' % test)
return