import platform
import unittest


def requires_platform(name):
    """Decorator used to skip tests if not running on the given platform.
    """

    if name == platform.system():
        return lambda func: func

    return unittest.skip(
        'Required platform "{}" does not match system'.format(name))