Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90b8f11

Browse filesBrowse files
committed
Remove assertion so that @image_comparison can be used outside a 'tests' module, but issue warning because the code logic seems a bit fragile and may fail.
1 parent 27cbd34 commit 90b8f11
Copy full SHA for 90b8f11

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎lib/matplotlib/testing/decorators.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/decorators.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,13 @@ def _image_directories(func):
359359
# namespace package pip installed and run via the nose
360360
# multiprocess plugin or as a specific test this may be
361361
# missing. See https://github.com/matplotlib/matplotlib/issues/3314
362-
assert mods.pop(0) == 'tests'
362+
if mods.pop(0) != 'tests':
363+
warnings.warn(("Module '%s' does not live in a parent module "
364+
"named 'tests'. This is probably ok, but we may not be able "
365+
"to guess the correct subdirectory containing the baseline "
366+
"images. If things go wrong please make sure that there is "
367+
"a parent directory named 'tests' and that it contains a "
368+
"__init__.py file (can be empty).") % module_name)
363369
subdir = os.path.join(*mods)
364370

365371
import imp

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.