From d01e309f2d1171629d190eafe94d041f51be8530 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 17 Dec 2018 13:00:30 +0100 Subject: [PATCH] Disable displaying warnings in functional tests Because of known issue with stestr running on Python 3, that too much output on stdout/stderr cause some subunit.parser errors, we need to avoid displaying python warnings during functional tests. Change-Id: I1a80f62542c68fe891e445920dc89a63efef9175 --- neutron/tests/functional/base.py | 5 +++++ tox.ini | 3 +++ 2 files changed, 8 insertions(+) diff --git a/neutron/tests/functional/base.py b/neutron/tests/functional/base.py index e46abadb047..901d39e05f3 100644 --- a/neutron/tests/functional/base.py +++ b/neutron/tests/functional/base.py @@ -14,6 +14,7 @@ # under the License. import os +import warnings from oslo_config import cfg @@ -31,6 +32,10 @@ DEFAULT_LOG_DIR = os.path.join(helpers.get_test_log_path(), class BaseLoggingTestCase(base.BaseTestCase): def setUp(self): super(BaseLoggingTestCase, self).setUp() + # NOTE(slaweq): Because of issue with stestr and Python3, we need + # to avoid too much output to be produced during tests, so we will + # ignore python warnings here + warnings.simplefilter("ignore") base.setup_test_logging( cfg.CONF, DEFAULT_LOG_DIR, "%s.txt" % self.id()) diff --git a/tox.ini b/tox.ini index 7fb2869dcdd..52b5e98acff 100644 --- a/tox.ini +++ b/tox.ini @@ -49,6 +49,9 @@ setenv = {[testenv]setenv} {[testenv:common]setenv} OS_TEST_PATH=./neutron/tests/functional OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs} +# Because of issue with stestr and Python3, we need to avoid too much output +# to be produced during tests, so we will ignore python warnings here + PYTHONWARNINGS=ignore deps = {[testenv]deps} -r{toxinidir}/neutron/tests/functional/requirements.txt