def run_test(
    func,
    points,
    *args,
    correct_message="default correct",
    error_message="default error",
    **kwargs
):
    """Run a pre-defined test function and creates a dictionary
    containing the results of the test

    Parameters
    ----------
    func : function or method
        Pre-defined test function to run
    points : int or float
        Number of points assigned for passing test
    *args
        Variable arguments passed to test function
    correct_message : str
        Custom message returned with passing test
    error_message : str
        Custom message returned with failing test
    **kwargs
        Keyword arguments passed to test function

    Returns
    -------
    results : dict with the following keys:
        points : int or float : points assigned based on test results
        pass : bool : passing status of test function
        description : str : test function name that was run
        message : str : custom message returned based on passing status
        traceback : AssertionError : returned from test function when pass is False
    """
    results = {"points": 0, "pass": False}
    score = 0
    try:
        fname = func.__name__
        results["description"] = fname
        func(*args, **kwargs)
    except Exception as e:
        results["message"] = error_message
        results["traceback"] = e
        pass
    else:
        results["pass"] = True
        results["message"] = correct_message
        results["points"] = points

    return results