def services_required(*req_services):
    def actual_decoration(obj):
        # make sure that we can decorate method and classes as well
        if inspect.isclass(obj):
            if not _is_test_cls(obj):
                raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
            skip_method = _mark_class_skipped
        else:
            if not _is_test_method_name(obj.__name__):
                raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
            skip_method = _mark_method_skipped
        # get available services from configuration
        avail_services = config.get_config().service_available
        for req_service in req_services:
            if not getattr(avail_services, req_service, False):
                obj = skip_method(obj, "%s service is required for this test"
                                       " to work properly." % req_service)
                break
        return obj
    return actual_decoration
Decorator for marking test's service requirements,
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/test/integration_tests/decorators.py/services_required