Browse Source

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
changes/71/625571/2
Slawek Kaplonski 3 years ago
parent
commit
d01e309f2d
2 changed files with 8 additions and 0 deletions
  1. +5
    -0
      neutron/tests/functional/base.py
  2. +3
    -0
      tox.ini

+ 5
- 0
neutron/tests/functional/base.py View File

@ -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())


+ 3
- 0
tox.ini View File

@ -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


Loading…
Cancel
Save