def dict_contains_sub_dict(config, test_config):
    """
    Determine whether a dictionary contains a sub-dictionary. Returns True if
    test_config is an empty dict.

    Parameters
    ----------
    config : dict
    test_config : dict
    """
    if not isinstance(config, dict) or not isinstance(test_config, dict):
        raise ValueError("config and test_config both must be dictionaries")

    if bool(test_config) is False:
        return True

    out = []
    for k, v in test_config.items():
        if not all(out):
            break
        if k not in config:
            out.append(False)
            continue
        elif isinstance(v, dict):
            out.append(dict_contains_sub_dict(config[k], test_config[k]))
        else:
            out.append(True if config[k] == v else False)
    return all(out)