Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a75feb

Browse files
committed
TST: tweak imports / whitespace in tests
1 parent 9893d4f commit 9a75feb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ def test_pep8_conformance_installed_files():
207207
'tests/test_delaunay.py',
208208
'tests/test_dviread.py',
209209
'tests/test_image.py',
210-
'tests/test_legend.py',
211210
'tests/test_lines.py',
212211
'tests/test_mathtext.py',
213212
'tests/test_rcparams.py',

lib/matplotlib/tests/test_legend.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
import numpy as np
1313

1414
from matplotlib.testing.decorators import image_comparison, cleanup
15-
from matplotlib.cbook import MatplotlibDeprecationWarning
1615
import matplotlib.pyplot as plt
1716
import matplotlib as mpl
18-
import matplotlib.patches as mpatches
1917
import matplotlib.transforms as mtrans
20-
import matplotlib.collections as mc
18+
import matplotlib.collections as mcollections
19+
2120

2221
@image_comparison(baseline_images=['legend_auto1'], remove_text=True)
2322
def test_legend_auto1():
@@ -110,7 +109,8 @@ def test_fancy():
110109
plt.subplot(121)
111110
plt.scatter(list(xrange(10)), list(xrange(10, 0, -1)), label='XX\nXX')
112111
plt.plot([5] * 10, 'o--', label='XX')
113-
plt.errorbar(list(xrange(10)), list(xrange(10)), xerr=0.5, yerr=0.5, label='XX')
112+
plt.errorbar(list(xrange(10)), list(xrange(10)), xerr=0.5,
113+
yerr=0.5, label='XX')
114114
plt.legend(loc="center left", bbox_to_anchor=[1.0, 0.5],
115115
ncol=2, shadow=True, title="My legend", numpoints=1)
116116

@@ -123,7 +123,8 @@ def test_framealpha():
123123
plt.legend(framealpha=0.5)
124124

125125

126-
@image_comparison(baseline_images=['scatter_rc3', 'scatter_rc1'], remove_text=True)
126+
@image_comparison(baseline_images=['scatter_rc3', 'scatter_rc1'],
127+
remove_text=True)
127128
def test_rc():
128129
# using subplot triggers some offsetbox functionality untested elsewhere
129130
fig = plt.figure()
@@ -221,8 +222,8 @@ def test_warn_args_kwargs(self):
221222
ax.legend((lnc, lns), labels=('a', 'b'))
222223

223224
warn.assert_called_with("You have mixed positional and keyword "
224-
"arguments, some input will be "
225-
"discarded.")
225+
"arguments, some input will be "
226+
"discarded.")
226227

227228

228229
@image_comparison(baseline_images=['legend_stackplot'], extensions=['png'])
@@ -273,10 +274,10 @@ def test_nanscatter():
273274

274275
@image_comparison(baseline_images=['not_covering_scatter'], extensions=['png'])
275276
def test_not_covering_scatter():
276-
colors = ['b','g','r']
277+
colors = ['b', 'g', 'r']
277278

278279
for n in range(3):
279-
plt.scatter([n,], [n,], color=colors[n])
280+
plt.scatter([n], [n], color=colors[n])
280281

281282
plt.legend(['foo', 'foo', 'foo'], loc='best')
282283
plt.gca().set_xlim(-0.5, 2.2)
@@ -301,9 +302,9 @@ def test_linecollection_scaled_dashes():
301302
lines1 = [[(0, .5), (.5, 1)], [(.3, .6), (.2, .2)]]
302303
lines2 = [[[0.7, .2], [.8, .4]], [[.5, .7], [.6, .1]]]
303304
lines3 = [[[0.6, .2], [.8, .4]], [[.5, .7], [.1, .1]]]
304-
lc1 = mc.LineCollection(lines1, linestyles="--", lw=3)
305-
lc2 = mc.LineCollection(lines2, linestyles="-.")
306-
lc3 = mc.LineCollection(lines3, linestyles=":", lw=.5)
305+
lc1 = mcollections.LineCollection(lines1, linestyles="--", lw=3)
306+
lc2 = mcollections.LineCollection(lines2, linestyles="-.")
307+
lc3 = mcollections.LineCollection(lines3, linestyles=":", lw=.5)
307308

308309
fig, ax = plt.subplots()
309310
ax.add_collection(lc1)

0 commit comments

Comments
 (0)