From 13f641c03b6a35f145a403cc2d56356a622bb6bc Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 17 Jan 2019 22:12:16 +0100 Subject: [PATCH] Suppress a warning in the test suite. Namely lib/matplotlib/tests/test_axes.py::test_step_linestyle[png] /lib/python3.7/site-packages/_pytest/python.py:165: RuntimeWarning: Second argument 'y' is ambiguous: could be a color spec but is in data; using as data. Either rename the entry in data or use three arguments to plot. testfunction(**testargs) /lib/python3.7/site-packages/_pytest/python.py:165: RuntimeWarning: Second argument 'y1' is ambiguous: could be a color spec but is in data; using as data. Either rename the entry in data or use three arguments to plot. testfunction(**testargs) /lib/python3.7/site-packages/_pytest/python.py:165: RuntimeWarning: Second argument 'y2' is ambiguous: could be a color spec but is in data; using as data. Either rename the entry in data or use three arguments to plot. testfunction(**testargs) --- lib/matplotlib/tests/test_axes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 1e549feda3d0..393bec8a923f 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -3642,14 +3642,14 @@ def test_step_linestyle(): ax.set_ylim([-1, 7]) # Reuse testcase from above for a labeled data test - data = {"x": x, "y": y, "y1": y+1, "y2": y+2} + data = {"X": x, "Y0": y, "Y1": y+1, "Y2": y+2} fig, ax_lst = plt.subplots(2, 2) ax_lst = ax_lst.flatten() ln_styles = ['-', '--', '-.', ':'] for ax, ls in zip(ax_lst, ln_styles): - ax.step("x", "y", lw=5, linestyle=ls, where='pre', data=data) - ax.step("x", "y1", lw=5, linestyle=ls, where='mid', data=data) - ax.step("x", "y2", lw=5, linestyle=ls, where='post', data=data) + ax.step("X", "Y0", lw=5, linestyle=ls, where='pre', data=data) + ax.step("X", "Y1", lw=5, linestyle=ls, where='mid', data=data) + ax.step("X", "Y2", lw=5, linestyle=ls, where='post', data=data) ax.set_xlim([-1, 5]) ax.set_ylim([-1, 7])