summaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'os_net_config/tests/base.py')
-rw-r--r--os_net_config/tests/base.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/os_net_config/tests/base.py b/os_net_config/tests/base.py
index 3bf12a8..c8ad7c4 100644
--- a/os_net_config/tests/base.py
+++ b/os_net_config/tests/base.py
@@ -18,6 +18,7 @@
import os
import fixtures
+import stubout
import testtools
_TRUE_VALUES = ('True', 'true', '1', 'yes')
@@ -31,6 +32,7 @@ class TestCase(testtools.TestCase):
"""Run before each test method to initialize test environment."""
super(TestCase, self).setUp()
+ self.stubs = stubout.StubOutForTesting()
test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0)
try:
test_timeout = int(test_timeout)
@@ -50,4 +52,9 @@ class TestCase(testtools.TestCase):
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
- self.log_fixture = self.useFixture(fixtures.FakeLogger()) \ No newline at end of file
+ self.log_fixture = self.useFixture(fixtures.FakeLogger())
+
+ def tearDown(self):
+ self.stubs.UnsetAll()
+ self.stubs.SmartUnsetAll()
+ super(TestCase, self).tearDown()