Fix skip decorator in integration tests

Fixes the method _mark_method_skipped because it seems that under
certain conditions nose is unable to recognize SkipTest exception and marks
the test with Error instead of Skip. This should be fixed by using
TestSkipped exception from testtools, which cleverly imports
correct SkipException.

Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1425660

Change-Id: Iccf0c2190fbb9faa68f9632841e1d9435e1bde75
This commit is contained in:
Tomáš Nováčik 2015-02-25 20:41:43 +01:00 committed by Tomáš Nová?ik
parent b5038ee423
commit 33523e01dc

View File

@ -14,7 +14,7 @@ import collections
import functools
import inspect
import nose
import testtools
from openstack_dashboard.test.integration_tests import config
@ -33,12 +33,12 @@ def _is_test_cls(cls):
def _mark_method_skipped(meth, reason):
"""Mark method as skipped by replacing the actual method with wrapper
that raises the nose.SkipTest exception.
that raises the testtools.testcase.TestSkipped exception.
"""
@functools.wraps(meth)
def wrapper(*args, **kwargs):
raise nose.SkipTest(reason)
raise testtools.testcase.TestSkipped(reason)
return wrapper