Skip to content

Commit

Permalink
Change from unittest to testtools
Browse files Browse the repository at this point in the history
part of bug 1177924

Change-Id: I99be2c48dc7143015883b89130083c8ea11abeec
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
  • Loading branch information
asalkeld committed May 16, 2013
1 parent 8da9ac2 commit e9a30f6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions ceilometer/storage/impl_mongodb.py
Expand Up @@ -213,8 +213,8 @@ def __init__(self, conf):
try:
from ming import mim
except ImportError:
import nose
raise nose.SkipTest("Ming not found")
import testtools
raise testtools.testcase.TestSkipped('requires mim')
LOG.debug('Creating a new MIM Connection object')
Connection._mim_instance = mim.Connection()
self.conn = Connection._mim_instance
Expand Down Expand Up @@ -564,8 +564,8 @@ def require_map_reduce(conn):
try:
from ming import mim
if hasattr(conn, "conn") and isinstance(conn.conn, mim.Connection):
import nose
raise nose.SkipTest('requires spidermonkey')
import testtools
raise testtools.testcase.TestSkipped('requires spidermonkey')
except ImportError:
import nose
raise nose.SkipTest('requires mim')
import testtools
raise testtools.testcase.TestSkipped('requires mim')
6 changes: 2 additions & 4 deletions ceilometer/tests/base.py
Expand Up @@ -18,17 +18,15 @@
# under the License.
"""Test base classes.
"""

import unittest2

import mox
from oslo.config import cfg
import stubout
import testtools

cfg.CONF.import_opt('pipeline_cfg_file', 'ceilometer.pipeline')


class TestCase(unittest2.TestCase):
class TestCase(testtools.TestCase):

def setUp(self):
super(TestCase, self).setUp()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_notifier.py
Expand Up @@ -108,6 +108,6 @@ def test_process_notification(self):

self.assertEqual(len(pub.counters), 0)
notifier.notify(None, MESSAGE)
self.assertGreater(len(pub.counters), 0)
self.assertTrue(len(pub.counters) > 0)
self.assertIn('disk.ephemeral.size',
[c.name for c in pub.counters])
2 changes: 1 addition & 1 deletion tools/test-requires
@@ -1,5 +1,4 @@
nose
unittest2
coverage
mock
mox
Expand All @@ -17,3 +16,4 @@ netifaces
sphinx
docutils==0.9.1 # for bug 1091333, remove after sphinx >1.1.3 is released.
python-spidermonkey
testtools>=0.9.29

0 comments on commit e9a30f6

Please sign in to comment.