Modify how to disable logging in unit test. 99/34999/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 18 May 2017 17:37:26 +0000 (19:37 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 18 May 2017 18:14:41 +0000 (20:14 +0200)
commited88e5e9abb8c24cee2507b62a45878637411c25
treed395423186a037b68796a942e9e3f5ece8c73369
parent510a5cfda3b375b432e0ed17a61e34de969b520c
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>
30 files changed:
functest/tests/unit/ci/test_prepare_env.py
functest/tests/unit/ci/test_run_tests.py
functest/tests/unit/ci/test_tier_builder.py
functest/tests/unit/ci/test_tier_handler.py
functest/tests/unit/cli/commands/test_cli_env.py
functest/tests/unit/cli/commands/test_cli_os.py
functest/tests/unit/cli/commands/test_cli_testcase.py
functest/tests/unit/cli/commands/test_cli_tier.py
functest/tests/unit/cli/test_cli_base.py
functest/tests/unit/core/test_feature.py
functest/tests/unit/core/test_pytest_suite_runner.py
functest/tests/unit/core/test_testcase.py
functest/tests/unit/core/test_vnf.py
functest/tests/unit/energy/test_functest_energy.py
functest/tests/unit/features/test_barometer.py
functest/tests/unit/odl/test_odl.py
functest/tests/unit/openstack/rally/test_rally.py
functest/tests/unit/openstack/refstack_client/test_refstack_client.py
functest/tests/unit/openstack/tempest/test_conf_utils.py
functest/tests/unit/openstack/tempest/test_tempest.py
functest/tests/unit/utils/test_decorators.py
functest/tests/unit/utils/test_functest_utils.py
functest/tests/unit/utils/test_openstack_clean.py
functest/tests/unit/utils/test_openstack_snapshot.py
functest/tests/unit/utils/test_openstack_tacker.py
functest/tests/unit/utils/test_openstack_utils.py
functest/tests/unit/vnf/ims/test_clearwater.py
functest/tests/unit/vnf/ims/test_cloudify_ims.py
functest/tests/unit/vnf/ims/test_ims_base.py
functest/tests/unit/vnf/ims/test_orchestrator_cloudify.py