summaryrefslogtreecommitdiff
path: root/nova/test.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-11-22 19:53:23 +0000
committerGerrit Code Review <review@openstack.org>2019-11-22 19:53:23 +0000
commit72a3013e76877ba1584592a88dcc4f9fbea0d123 (patch)
tree8df45316048ccf3c7eea58150dbb903a5d15c07d /nova/test.py
parent4ff279652479719068bfc6d08bf868268ce15ff9 (diff)
parente11a0210622ee8e5ed22039158c9a4f129fa122c (diff)
downloadnova-72a3013e76877ba1584592a88dcc4f9fbea0d123.tar.gz
Merge "test cleanup: Remove skipIf test decorator"
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/nova/test.py b/nova/test.py
index 937bdfd279..93edb8ad7b 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -122,38 +122,6 @@ class TestingException(Exception):
pass
-class skipIf(object):
- def __init__(self, condition, reason):
- self.condition = condition
- self.reason = reason
-
- def __call__(self, func_or_cls):
- condition = self.condition
- reason = self.reason
- if inspect.isfunction(func_or_cls):
- @six.wraps(func_or_cls)
- def wrapped(*args, **kwargs):
- if condition:
- raise testtools.TestCase.skipException(reason)
- return func_or_cls(*args, **kwargs)
-
- return wrapped
- elif inspect.isclass(func_or_cls):
- orig_func = getattr(func_or_cls, 'setUp')
-
- @six.wraps(orig_func)
- def new_func(self, *args, **kwargs):
- if condition:
- raise testtools.TestCase.skipException(reason)
- orig_func(self, *args, **kwargs)
-
- func_or_cls.setUp = new_func
- return func_or_cls
- else:
- raise TypeError('skipUnless can be used only with functions or '
- 'classes')
-
-
# NOTE(claudiub): this needs to be called before any mock.patch calls are
# being done, and especially before any other test classes load. This fixes
# the mock.patch autospec issue: