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 541b924

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. In this case, the context doesn't set anything that would affect figures, so inline the effect of the context as keyword arguments.
1 parent 1e8ea2f commit 541b924
Copy full SHA for 541b924

File tree

1 file changed

+3
-3
lines changed
Filter options

1 file changed

+3
-3
lines changed

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,6 @@ def test_check_offsets_dtype():
13111311

13121312
@pytest.mark.parametrize('gapcolor', ['orange', ['r', 'k']])
13131313
@check_figures_equal(extensions=['png'])
1314-
@mpl.rc_context({'lines.linewidth': 20})
13151314
def test_striped_lines(fig_test, fig_ref, gapcolor):
13161315
ax_test = fig_test.add_subplot(111)
13171316
ax_ref = fig_ref.add_subplot(111)
@@ -1323,11 +1322,12 @@ def test_striped_lines(fig_test, fig_ref, gapcolor):
13231322
x = range(1, 6)
13241323
linestyles = [':', '-', '--']
13251324

1326-
ax_test.vlines(x, 0, 1, linestyle=linestyles, gapcolor=gapcolor, alpha=0.5)
1325+
ax_test.vlines(x, 0, 1, linewidth=20, linestyle=linestyles, gapcolor=gapcolor,
1326+
alpha=0.5)
13271327

13281328
if isinstance(gapcolor, str):
13291329
gapcolor = [gapcolor]
13301330

13311331
for x, gcol, ls in zip(x, itertools.cycle(gapcolor),
13321332
itertools.cycle(linestyles)):
1333-
ax_ref.axvline(x, 0, 1, linestyle=ls, gapcolor=gcol, alpha=0.5)
1333+
ax_ref.axvline(x, 0, 1, linewidth=20, linestyle=ls, gapcolor=gcol, alpha=0.5)

0 commit comments

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