def METHOD_NAME(sampler, max_num_variables=None,
                           suppress_overload_warning=False):
    """Populate the decorated TestCase with sampler tests using small BQMs.
    Args:
        sampler (obj/callable):
            A :class:`.Sampler`. If given as an object, the same sampler will
            be used for all tests, if given as a callable a new sampler will
            be instantiated for each test.
        max_num_variables (int, optional):
            The maximum BQM size to be tested. Defaults to unlimited.
        suppress_overload_warning (bool, optional, default=False):
            If True and the decorated class has a method matching one of the
            ones generated by `load_sampler_bqm_tests`, a warning will be
            emitted.
    Example:
        For example, if one wanted to test the :class:`.ExactSolver`,
        .. code-block:: python
            import unittest
            import dimod.testing
            @dimod.testing.load_sampler_bqm_tests(dimod.ExactSolver)
            class TestExactSolver(unittest.TestCase):
                pass
            unittest.main()
    """
    if isinstance(sampler, collections.abc.Callable):
        sampler_factory = sampler
    else:
        def sampler_factory():
            return sampler
        sampler_factory.__name__ = str(sampler)
    def decorator(cls):
        for test_method in create_bqm_tests(sampler_factory,
                                            max_num_variables=max_num_variables):
            if not hasattr(cls, test_method.__name__):
                setattr(cls, test_method.__name__, test_method)
            elif not suppress_overload_warning:
                msg = ('{} has been overloaded. If this is the desired '
                       'behaviour, this warning can be suppressed with the '
                       'suppress_overload_warning kwarg.')
                warnings.warn(msg, TestCaseOverloadWarning)
        return cls
    return decorator