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:
parent
b68d66b020
commit
72cadd4f38
|
@ -21,14 +21,13 @@ import select
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import unittest
|
import testtools
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
from eventlet import greenpool
|
from eventlet import greenpool
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
|
|
||||||
from openstack.common import lockutils
|
from openstack.common import lockutils
|
||||||
from openstack.common import testutils
|
|
||||||
from tests import utils as test_utils
|
from tests import utils as test_utils
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import unittest
|
import testtools
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstack.common import processutils
|
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
|
# NOTE(jkoelker) Moar tests from nova need to be ported. But they
|
||||||
# need to be mock'd out. Currently they requre actually
|
# need to be mock'd out. Currently they requre actually
|
||||||
# running code.
|
# running code.
|
||||||
|
@ -32,7 +32,7 @@ class UtilsTest(unittest.TestCase):
|
||||||
hozer=True)
|
hozer=True)
|
||||||
|
|
||||||
|
|
||||||
class ProcessExecutionErrorTest(unittest.TestCase):
|
class ProcessExecutionErrorTest(testtools.TestCase):
|
||||||
|
|
||||||
def test_defaults(self):
|
def test_defaults(self):
|
||||||
err = processutils.ProcessExecutionError()
|
err = processutils.ProcessExecutionError()
|
||||||
|
|
Loading…
Reference in New Issue