FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Write out the results of tests that don't yet have baseline images. by mdboom · Pull Request #73 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
13 changes: 6 additions & 7 deletions lib/matplotlib/testing/decorators.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ def compare_images_generator():
for extension in extensions:
orig_expected_fnames = [os.path.join(baseline_dir,fname) + '.' + extension for fname in baseline_images]
expected_fnames = [os.path.join(result_dir,'expected-'+fname) + '.' + extension for fname in baseline_images]
for src,dst in zip( orig_expected_fnames, expected_fnames ):
shutil.copyfile(src,dst)
actual_fnames = [os.path.join(result_dir, fname) + '.' + extension for fname in baseline_images]
have_baseline_images = [os.path.exists(expected) for expected in expected_fnames]
have_baseline_images = [os.path.exists(expected) for expected in orig_expected_fnames]
have_baseline_image = np.all(have_baseline_images)
is_comparable = extension in comparable_formats()
if not is_comparable:
Expand All @@ -112,11 +110,12 @@ def decorated_compare_images():
result = func() # actually call the test function
finally:
os.chdir(old_dir)
for actual,expected in zip(actual_fnames,expected_fnames):
if not os.path.exists(expected):
for original, expected in zip(orig_expected_fnames, expected_fnames):
if not os.path.exists(original):
raise ImageComparisonFailure(
'image does not exist: %s'%expected)

'image does not exist: %s'%original)
shutil.copyfile(original, expected)
for actual,expected in zip(actual_fnames,expected_fnames):
# compare the images
err = compare_images( expected, actual, tol,
in_decorator=True )
Expand Down

Back | FazBrowse Home | New Git URL