Use testtools as test base class.

On the path to testr migration, we need to replace the unittest base classes
with testtools.
Replace tearDown with addCleanup, addCleanup is more resilient than tearDown.
The fixtures library has excellent support for managing and cleaning
tempfiles. Use it.
Replace skip_ with testtools.skipTest

Part of blueprint grizzly-testtools.

Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
This commit is contained in:
Monty Taylor 2013-01-22 19:54:57 -05:00
parent b68d66b020
commit 72cadd4f38
2 changed files with 4 additions and 5 deletions

View File

@ -21,14 +21,13 @@ import select
import shutil
import tempfile
import time
import unittest
import testtools
import eventlet
from eventlet import greenpool
from eventlet import greenthread
from openstack.common import lockutils
from openstack.common import testutils
from tests import utils as test_utils

View File

@ -15,14 +15,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import unittest
import testtools
import mock
from openstack.common import processutils
class UtilsTest(unittest.TestCase):
class UtilsTest(testtools.TestCase):
# NOTE(jkoelker) Moar tests from nova need to be ported. But they
# need to be mock'd out. Currently they requre actually
# running code.
@ -32,7 +32,7 @@ class UtilsTest(unittest.TestCase):
hozer=True)
class ProcessExecutionErrorTest(unittest.TestCase):
class ProcessExecutionErrorTest(testtools.TestCase):
def test_defaults(self):
err = processutils.ProcessExecutionError()