Skip to content

Commit 0bc3f4d

Browse files
committed
ENH #1854: Tests will check for alternate baselines using basename_[1-9].ext
Previously the pattern used was baseline.*\.ext
1 parent 1c84b48 commit 0bc3f4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testing/checkimage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import vtk
1010
import os
1111
import os.path
12+
import re
1213
import sys
1314
import logging
1415

@@ -40,13 +41,15 @@ def image_from_file(fname):
4041
print "Problem opening file '%s': %s"%(fname,err)
4142
return None
4243

44+
# find alternate baselines for fname of the form basename_d.ext
45+
# where fname = basename.ext and d is a digit between 1 and 9
4346
def find_alternates(fname):
4447
dirname = os.path.dirname(fname)
4548
prefix, ext = os.path.splitext(os.path.split(fname)[1])
4649
files = os.listdir(dirname)
4750
results = [fname]
4851
for i in files:
49-
if i.startswith(prefix) and i.endswith(ext) and i != prefix+ext:
52+
if (re.match(prefix + '_[1-9]' + ext, i)):
5053
results.append(os.path.join(dirname, i))
5154
return results
5255

0 commit comments

Comments
 (0)