def requires_network(f):
    """
    Decorator for specifying that a test needs a network connection.
    If no network connection is available, skip test.
    :param f: test function
    :type f: callable
    :return: decorated function
    :rtype: callable
    """
    network_unavailable = (not network_is_available())
    return unittest.skipIf(network_unavailable, "No network connection available.")(f)

    Decorator for specifying that a test needs a network connection.
    If no network connection is available, skip test.
    :param f: test function
    :type f: callable
    :return: decorated function
    :rtype: callable
    
tests/stashtest.py