Skip to content

Commit bc3cb78

Browse files
committed
tests: use oslo_config.fixture in the unit tests
We need to use the config fixture in order to deal properly with unit tests and configuration flags.
1 parent 3df3d89 commit bc3cb78

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

deepaas/tests/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
import fixtures
2020
from oslo_config import cfg
21+
from oslo_config import fixture as config_fixture
22+
from oslo_log import log as logging
2123
import testtools
2224

2325
CONF = cfg.CONF
26+
logging.register_options(CONF)
27+
2428

2529
_TRUE_VALUES = ('True', 'true', '1', 'yes')
2630

@@ -42,6 +46,8 @@ def setUp(self):
4246
if test_timeout > 0:
4347
self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
4448

49+
self.useFixture(config_fixture.Config(CONF))
50+
4551
if os.environ.get('TESTR_STDOUT_CAPTURE') in _TRUE_VALUES:
4652
stdout = self.useFixture(fixtures.StringStream('stdout')).stream
4753
self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout))

0 commit comments

Comments
 (0)