summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/vnf/ims/test_clearwater.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-18 19:37:26 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-18 20:14:41 +0200
commited88e5e9abb8c24cee2507b62a45878637411c25 (patch)
treed395423186a037b68796a942e9e3f5ece8c73369 /functest/tests/unit/vnf/ims/test_clearwater.py
parent510a5cfda3b375b432e0ed17a61e34de969b520c (diff)
Modify how to disable logging in unit test.
Logs are only disabled when the unit tests are run from cmdline. It allows running them via pytest_suite_runner.py and printing their results to functest.log. You should notice that the unit test must disable the logger of the tested TestCase (e.g. testcase.TestCase.logger.disabled = 1). Otherwise false logs will be printed in console. Change-Id: Ic171e4575c8bab2e52db1897ae026b61a03b6247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/vnf/ims/test_clearwater.py')
-rw-r--r--functest/tests/unit/vnf/ims/test_clearwater.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/functest/tests/unit/vnf/ims/test_clearwater.py b/functest/tests/unit/vnf/ims/test_clearwater.py
index 18bebfdf..bc31c33e 100644
--- a/functest/tests/unit/vnf/ims/test_clearwater.py
+++ b/functest/tests/unit/vnf/ims/test_clearwater.py
@@ -16,8 +16,6 @@ from functest.opnfv_tests.vnf.ims import orchestrator_cloudify
class ClearwaterTesting(unittest.TestCase):
- logging.disable(logging.CRITICAL)
-
def setUp(self):
self.clearwater = clearwater.Clearwater()
self.orchestrator = orchestrator_cloudify.Orchestrator('test_dir')
@@ -83,4 +81,5 @@ class ClearwaterTesting(unittest.TestCase):
'test_domain')
if __name__ == "__main__":
+ logging.disable(logging.CRITICAL)
unittest.main(verbosity=2)