diff options
Diffstat (limited to 'tests/mixins.py')
-rw-r--r-- | tests/mixins.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/mixins.py b/tests/mixins.py index 8fe0690b..4954a6a5 100644 --- a/tests/mixins.py +++ b/tests/mixins.py @@ -13,7 +13,6 @@ import os.path import sys import types import textwrap -import unittest import pytest @@ -148,19 +147,19 @@ class TempDirMixin(object): def convert_skip_exceptions(method): - """A decorator for test methods to convert StopEverything to SkipTest.""" + """A decorator for test methods to convert StopEverything to skips.""" @functools.wraps(method) def _wrapper(*args, **kwargs): try: result = method(*args, **kwargs) except StopEverything: - raise unittest.SkipTest("StopEverything!") + pytest.skip("StopEverything!") return result return _wrapper class SkipConvertingMetaclass(type): - """Decorate all test methods to convert StopEverything to SkipTest.""" + """Decorate all test methods to convert StopEverything to skips.""" def __new__(cls, name, bases, attrs): for attr_name, attr_value in attrs.items(): if attr_name.startswith('test_') and isinstance(attr_value, types.FunctionType): |