Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2c2920

Browse files
committed
Let triage_tests support test modules with only figure_equals tests.
If there's only check_figure_equals tests in a module (e.g. test_pickle, test_axis) then there's no directory in the baseline_images test, but it still makes sense to run triage_tests in case of test failure. Previously, the missing directory caused an error; this patches fixes that. To test this, change e.g. one of the check_figures_equal tests in test_pickle to make it fail, run that test, and run tools/triage_tests.py.
1 parent 1f8ff33 commit f2c2920

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/triage_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def __init__(self, path, root, source):
263263
]
264264
self.thumbnails = [self.dir / x for x in self.thumbnails]
265265

266-
if not Path(self.destdir, self.generated).exists():
266+
if self.destdir is None or not Path(self.destdir, self.generated).exists():
267267
# This case arises from a check_figures_equal test.
268268
self.status = 'autogen'
269269
elif ((self.dir / self.generated).read_bytes()
@@ -281,7 +281,6 @@ def get_dest_dir(self, reldir):
281281
path = self.source / baseline_dir / reldir
282282
if path.is_dir():
283283
return path
284-
raise ValueError(f"Can't find baseline dir for {reldir}")
285284

286285
@property
287286
def display(self):

0 commit comments

Comments
 (0)