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
This commit is contained in:
parent
17c6cf7abe
commit
d01e309f2d
|
@ -14,6 +14,7 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
@ -31,6 +32,10 @@ DEFAULT_LOG_DIR = os.path.join(helpers.get_test_log_path(),
|
||||||
class BaseLoggingTestCase(base.BaseTestCase):
|
class BaseLoggingTestCase(base.BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BaseLoggingTestCase, self).setUp()
|
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(
|
base.setup_test_logging(
|
||||||
cfg.CONF, DEFAULT_LOG_DIR, "%s.txt" % self.id())
|
cfg.CONF, DEFAULT_LOG_DIR, "%s.txt" % self.id())
|
||||||
|
|
||||||
|
|
3
tox.ini
3
tox.ini
|
@ -49,6 +49,9 @@ setenv = {[testenv]setenv}
|
||||||
{[testenv:common]setenv}
|
{[testenv:common]setenv}
|
||||||
OS_TEST_PATH=./neutron/tests/functional
|
OS_TEST_PATH=./neutron/tests/functional
|
||||||
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
|
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 =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
-r{toxinidir}/neutron/tests/functional/requirements.txt
|
-r{toxinidir}/neutron/tests/functional/requirements.txt
|
||||||
|
|
Loading…
Reference in New Issue