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 3b00a95

Browse filesBrowse files
Kojoleytacaswell
authored andcommitted
Do not rely on outer scope variables in ImageComparisonTest.test.do_test
`do_test` function variables are changed by loop where function was creates. It will work as you expect only if you call yielded function immediately.
1 parent 814fff5 commit 3b00a95
Copy full SHA for 3b00a95

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/testing/decorators.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/decorators.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def test(self):
237237
@knownfailureif(
238238
will_fail, fail_msg,
239239
known_exception_class=ImageComparisonFailure)
240-
def do_test():
240+
def do_test(fignum, actual_fname, expected_fname):
241241
figure = plt.figure(fignum)
242242

243243
if self._remove_text:
@@ -264,7 +264,7 @@ def do_test():
264264
(self._freetype_version, ft2font.__freetype_version__))
265265
raise
266266

267-
yield (do_test,)
267+
yield do_test, fignum, actual_fname, expected_fname
268268

269269
def image_comparison(baseline_images=None, extensions=None, tol=0,
270270
freetype_version=None, remove_text=False,

0 commit comments

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