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 5bd9a60

Browse filesBrowse files
committed
TST: Fix image comparison directory for test_striped_lines
The image comparison directory is determined by `inspect.getfile(func)`, but when a test is wrapped in `rc_context`, the file returned is `contextlib` since that decorator is `contextlib.contextmanager`. Since this test uses `check_figures_equal`, that doesn't break it, but it does break the `triage_tests.py` tool as it cannot find a corresponding baseline image directory. Moving the `rc_context` decorator above `check_figures_equal` fixes the determined directory. While in this case, the context doesn't set anything that would affect figures, it also makes sense to set the context before figures are created.
1 parent 1e8ea2f commit 5bd9a60
Copy full SHA for 5bd9a60

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-1
lines changed

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,9 +1309,9 @@ def test_check_offsets_dtype():
13091309
assert isinstance(scat.get_offsets(), type(unmasked_offsets))
13101310

13111311

1312+
@mpl.rc_context({'lines.linewidth': 20})
13121313
@pytest.mark.parametrize('gapcolor', ['orange', ['r', 'k']])
13131314
@check_figures_equal(extensions=['png'])
1314-
@mpl.rc_context({'lines.linewidth': 20})
13151315
def test_striped_lines(fig_test, fig_ref, gapcolor):
13161316
ax_test = fig_test.add_subplot(111)
13171317
ax_ref = fig_ref.add_subplot(111)

0 commit comments

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