def METHOD_NAME(self, dd_run_check):
    check = get_legacy_check({'share_labels': {'foo': 9000}})
    with pytest.raises(
        Exception, match='^Metric `foo` of setting `share_labels` must be a mapping or set to `true`$'
    ):
        dd_run_check(check, extract_message=True)