Skip to content

Commit df4e413

Browse files
committed
fix errors highlighted in travis CI logs
1 parent b56297f commit df4e413

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from numpy.testing import assert_array_equal
2626
import warnings
2727
from matplotlib.cbook import IgnoredKeywordWarning
28+
import pytest
2829

2930
# Note: Some test cases are run twice: once normally and once with labeled data
3031
# These two must be defined in the same test function or need to have
@@ -120,22 +121,22 @@ def test_twinx_cla():
120121
ax2 = ax.twinx()
121122
ax3 = ax2.twiny()
122123
plt.draw()
123-
assert ax2.xaxis.get_visible() == False
124-
assert x2.patch.get_visible() == False
124+
assert not ax2.xaxis.get_visible()
125+
assert not x2.patch.get_visible()
125126
ax2.cla()
126127
ax3.cla()
127128

128-
assert ax2.xaxis.get_visible() == False
129-
assert ax2.patch.get_visible() == False
130-
assert ax2.yaxis.get_visible() == True
129+
assert not ax2.xaxis.get_visible()
130+
assert not ax2.patch.get_visible()
131+
assert ax2.yaxis.get_visible()
131132

132-
assert ax3.xaxis.get_visible() == True
133-
assert ax3.patch.get_visible() == False
134-
assert ax3.yaxis.get_visible() == False
133+
assert ax3.xaxis.get_visible()
134+
assert not ax3.patch.get_visible()
135+
assert not ax3.yaxis.get_visible()
135136

136-
assert ax.xaxis.get_visible() == True
137-
assert ax.patch.get_visible() == True
138-
assert ax.yaxis.get_visible() == True
137+
assert ax.xaxis.get_visible()
138+
assert ax.patch.get_visible()
139+
assert ax.yaxis.get_visible()
139140

140141

141142
@image_comparison(baseline_images=["minorticks_on_rcParams_both"], extensions=['png'])

lib/matplotlib/tests/test_collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def test__EventCollection__set_orientation():
266266
new_orientation = 'vertical'
267267
coll.set_orientation(new_orientation)
268268
assert new_orientation == coll.get_orientation()
269-
assert_ not coll.is_horizontal()
269+
assert not coll.is_horizontal()
270270
check_segments(coll,
271271
props['positions'],
272272
props['linelength'],

lib/matplotlib/tests/test_dates.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ def test_strftime_fields(dt):
197197
locale_formatter = mdates.DateFormatter("%x")
198198
locale_d_fmt = locale.nl_langinfo(locale.D_FMT)
199199
expanded_formatter = mdates.DateFormatter(locale_d_fmt)
200-
assert locale_formatter.strftime(dt) ==
201-
expanded_formatter.strftime(dt)
200+
assert locale_formatter.strftime(dt) == expanded_formatter.strftime(dt)
202201
except (ImportError, AttributeError):
203202
pass
204203

lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ def test_json_serialization():
4646
{'family': 'Bitstream Vera Sans', 'weight': 700},
4747
{'family': 'no such font family'}):
4848
fp = FontProperties(**prop)
49-
assertfontManager.findfont(fp, rebuild_if_missing=False) ==
49+
assert fontManager.findfont(fp, rebuild_if_missing=False) ==
5050
copy.findfont(fp, rebuild_if_missing=False)

lib/matplotlib/tests/test_patheffects.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ def test_PathEffect_points_to_pixels():
101101

102102
# Confirm that using a path effects renderer maintains point sizes
103103
# appropriately. Otherwise rendered font would be the wrong size.
104-
assert renderer.points_to_pixels(15) ==
105-
pe_renderer.points_to_pixels(15)
104+
assert renderer.points_to_pixels(15) == pe_renderer.points_to_pixels(15)
106105

107106

108107
def test_SimplePatchShadow_offset():

lib/matplotlib/tests/test_simplification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_start_with_moveto():
161161
assert segs[0][1] == Path.MOVETO
162162

163163
@cleanup
164-
@raises(OverflowError)
164+
@pytest.mark.xfail(raises=OverflowError)
165165
def test_throw_rendering_complexity_exceeded():
166166
rcParams['path.simplify'] = False
167167
xx = np.arange(200000)

0 commit comments

Comments
 (0)