Conditionals were not actually runing the tests when they were supposed to. Renamed example testcases
This commit is contained in:
@@ -79,6 +79,7 @@ class skip_if(object):
|
||||
"""Wrapped skipper function."""
|
||||
if self.condition:
|
||||
raise nose.SkipTest(self.message)
|
||||
func(*args, **kw)
|
||||
_skipper.__name__ = func.__name__
|
||||
_skipper.__doc__ = func.__doc__
|
||||
return _skipper
|
||||
@@ -95,6 +96,7 @@ class skip_unless(object):
|
||||
"""Wrapped skipper function."""
|
||||
if not self.condition:
|
||||
raise nose.SkipTest(self.message)
|
||||
func(*args, **kw)
|
||||
_skipper.__name__ = func.__name__
|
||||
_skipper.__doc__ = func.__doc__
|
||||
return _skipper
|
||||
|
||||
@@ -21,13 +21,13 @@ from nova import test
|
||||
|
||||
class ExampleSkipTestCase(test.TestCase):
|
||||
@test.skip_test("Example usage of @test.skip_test()")
|
||||
def test_skip_test(self):
|
||||
def test_skip_test_example(self):
|
||||
self.fail("skip_test failed to work properly.")
|
||||
|
||||
@test.skip_if(True, "Example usage of @test.skip_if()")
|
||||
def test_skip_if_env_user_exists(self):
|
||||
def test_skip_if_example(self):
|
||||
self.fail("skip_if failed to work properly.")
|
||||
|
||||
@test.skip_unless(False, "Example usage of @test.skip_unless()")
|
||||
def test_skip_unless_env_foo_exists(self):
|
||||
def test_skip_unless_example(self):
|
||||
self.fail("skip_unless failed to work properly.")
|
||||
|
||||
Reference in New Issue
Block a user