diff --git a/kallithea/tests/__init__.py b/kallithea/tests/__init__.py --- a/kallithea/tests/__init__.py +++ b/kallithea/tests/__init__.py @@ -55,7 +55,7 @@ from nose.plugins.skip import SkipTest from kallithea.lib.compat import unittest from kallithea import is_windows from kallithea.model.db import User -from kallithea.tests.nose_parametrized import parameterized +from kallithea.tests.parameterized import parameterized from kallithea.lib.utils2 import safe_str diff --git a/kallithea/tests/nose_parametrized.py b/kallithea/tests/parameterized.py rename from kallithea/tests/nose_parametrized.py rename to kallithea/tests/parameterized.py --- a/kallithea/tests/nose_parametrized.py +++ b/kallithea/tests/parameterized.py @@ -5,10 +5,27 @@ import logging import logging.handlers from functools import wraps -from nose.tools import nottest from unittest import TestCase +def skip_test(func): + try: + from nose.tools import nottest + except ImportError: + pass + else: + func = nottest(func) + + try: + import pytest + except ImportError: + pass + else: + func = pytest.mark.skipIf(True, func) + + return func + + def _terrible_magic_get_defining_classes(): """ Returns the set of parent classes of the class currently being defined. Will likely only work if called from the ``parameterized`` decorator. @@ -125,7 +142,7 @@ def parameterized_expand(input): name = base_name + name_suffix new_func = parameterized_expand_helper(name, f, args) frame_locals[name] = new_func - return nottest(f) + return skip_test(f) return parameterized_expand_wrapper parameterized.expand = parameterized_expand