Esempio n. 1
0
def compare_figure(fname, savefig_kwargs={}, tol=0):
    actual = os.path.join(result_dir, fname)
    plt.savefig(actual, **savefig_kwargs)

    expected = os.path.join(result_dir, "expected_%s" % fname)
    shutil.copyfile(os.path.join(baseline_dir, fname), expected)
    err = compare_images(expected, actual, tol=tol)
    if err:
        raise ImageComparisonFailure(err)
Esempio n. 2
0
def compare_figure(fname):
    actual = os.path.join(result_dir, fname)
    plt.savefig(actual)

    expected = os.path.join(result_dir, "expected_%s" % fname)
    shutil.copyfile(os.path.join(baseline_dir, fname), expected)
    err = compare_images(expected, actual, tol=14)
    if err:
        raise ImageComparisonFailure('images not close: %s vs. %s' % (actual, expected))
Esempio n. 3
0
def compare_figure(fname, savefig_kwargs={}, tol=0):
    # TODO remove this before tagging 2.0
    raise KnownFailureTest('temporarily disabled until 2.0 tag')
    actual = os.path.join(result_dir, fname)
    plt.savefig(actual, **savefig_kwargs)

    expected = os.path.join(result_dir, "expected_%s" % fname)
    shutil.copyfile(os.path.join(baseline_dir, fname), expected)
    err = compare_images(expected, actual, tol=tol)
    if err:
        raise ImageComparisonFailure(err)