import functools
import unittest

try:

    import sympy

    def requires_sympy(func):
        @functools.wraps(func)
        def wrapper(self):
            return func(self)
        return wrapper

except ImportError:

    def requires_sympy(func):
        @functools.wraps(func)
        def wrapper(self):
            raise unittest.SkipTest('SymPy is not available')
        return wrapper
