summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-03 17:53:41 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-04 17:22:36 +0000
commit8813ab185d0b6ad1c111e7f9e346e2ce91c8113b (patch)
tree13d4ae5f62ade4142c8b23ea1738742d90db6519 /nova/test.py
parentd0cae6b5a16a5873afbcd47ba8ee5e97b6a25072 (diff)
assertRaises(Exception, ...) considered harmful
Expecting that Exception is raised can end up passing an a test when an unexpected error occurs. For instance, errors in the unit test itself can be masked: https://review.openstack.org/4848 https://review.openstack.org/4873 https://review.openstack.org/4874 Change a variety of unit tests to expect a more specific exception so we don't run into false positive tests in the future. Change-Id: Ibc0c63b1f6b5574a3ce93d9f02c9d1ff5ac4a8b0
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/test.py b/nova/test.py
index db0bb7d24..b38de5303 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -115,6 +115,10 @@ def skip_if_fake(func):
return _skipper
+class TestingException(Exception):
+ pass
+
+
class TestCase(unittest.TestCase):
"""Test case base class for all unit tests."""