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

Skip to content

Commit dbf6928

Browse files
committed
Remove explicit checks for Python 2.6.
1 parent f91dff4 commit dbf6928

File tree

6 files changed

+2
-57
lines changed

6 files changed

+2
-57
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
unicode_literals)
33

44
import six
5-
import sys
65
import io
76
import os
87

@@ -573,10 +572,6 @@ def test_minimized_rasterized():
573572
# in Postscript, the best way to detect it is to generate SVG
574573
# and then parse the output to make sure the two colorbar images
575574
# are the same size.
576-
if sys.version_info[:2] < (2, 7):
577-
raise nose.SkipTest("xml.etree.ElementTree.Element.iter "
578-
"added in py 2.7")
579-
580575
from xml.etree import ElementTree
581576

582577
np.random.seed(0)

lib/matplotlib/tests/test_lines.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import matplotlib.pyplot as plt
1818
from matplotlib.testing.decorators import cleanup, image_comparison
1919

20-
import sys
21-
2220

2321
@cleanup
2422
def test_invisible_Line_rendering():
@@ -112,10 +110,6 @@ def test_linestyle_variants():
112110

113111
@cleanup
114112
def test_valid_linestyles():
115-
if sys.version_info[:2] < (2, 7):
116-
raise nose.SkipTest("assert_raises as context manager "
117-
"not supported with Python < 2.7")
118-
119113
line = mlines.Line2D([], [])
120114
with assert_raises(ValueError):
121115
line.set_linestyle('aardvark')
@@ -135,10 +129,6 @@ def test_drawstyle_variants():
135129

136130
@cleanup
137131
def test_valid_drawstyles():
138-
if sys.version_info[:2] < (2, 7):
139-
raise nose.SkipTest("assert_raises as context manager "
140-
"not supported with Python < 2.7")
141-
142132
line = mlines.Line2D([], [])
143133
with assert_raises(ValueError):
144134
line.set_drawstyle('foobar')

lib/matplotlib/tests/test_rcparams.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import io
77
import os
8-
import sys
98
import warnings
9+
from collections import OrderedDict
1010

1111
from cycler import cycler, Cycler
1212

@@ -16,7 +16,6 @@
1616
from matplotlib.testing.decorators import cleanup, knownfailureif
1717
import matplotlib.colors as mcolors
1818
from nose.tools import assert_true, assert_raises, assert_equal
19-
from nose.plugins.skip import SkipTest
2019
import nose
2120
from itertools import chain
2221
import numpy as np
@@ -115,9 +114,6 @@ def test_RcParams_class():
115114

116115

117116
def test_rcparams_update():
118-
if sys.version_info[:2] < (2, 7):
119-
raise nose.SkipTest("assert_raises as context manager "
120-
"not supported with Python < 2.7")
121117
rc = mpl.RcParams({'figure.figsize': (3.5, 42)})
122118
bad_dict = {'figure.figsize': (3.5, 42, 1)}
123119
# make sure validation happens on input
@@ -131,9 +127,6 @@ def test_rcparams_update():
131127

132128

133129
def test_rcparams_init():
134-
if sys.version_info[:2] < (2, 7):
135-
raise nose.SkipTest("assert_raises as context manager "
136-
"not supported with Python < 2.7")
137130
with assert_raises(ValueError):
138131
with warnings.catch_warnings():
139132
warnings.filterwarnings('ignore',
@@ -172,14 +165,6 @@ def test_Bug_2543():
172165
mpl.rcParams['svg.embed_char_paths'] = False
173166
assert_true(mpl.rcParams['svg.fonttype'] == "none")
174167

175-
176-
@cleanup
177-
def test_Bug_2543_newer_python():
178-
# only split from above because of the usage of assert_raises
179-
# as a context manager, which only works in 2.7 and above
180-
if sys.version_info[:2] < (2, 7):
181-
raise nose.SkipTest("assert_raises as context manager not supported with Python < 2.7")
182-
from matplotlib.rcsetup import validate_bool_maybe_none, validate_bool
183168
with assert_raises(ValueError):
184169
validate_bool_maybe_none("blah")
185170
with assert_raises(ValueError):
@@ -249,9 +234,6 @@ def _validation_test_helper(validator, arg, target):
249234

250235

251236
def _validation_fail_helper(validator, arg, exception_type):
252-
if sys.version_info[:2] < (2, 7):
253-
raise nose.SkipTest("assert_raises as context manager not "
254-
"supported with Python < 2.7")
255237
with assert_raises(exception_type):
256238
validator(arg)
257239

@@ -395,11 +377,6 @@ def test_rcparams_reset_after_fail():
395377
# raised an exception due to issues in the supplied rc parameters, the
396378
# global rc parameters were left in a modified state.
397379

398-
if sys.version_info[:2] >= (2, 7):
399-
from collections import OrderedDict
400-
else:
401-
raise SkipTest("Test can only be run in Python >= 2.7 as it requires OrderedDict")
402-
403380
with mpl.rc_context(rc={'text.usetex': False}):
404381

405382
assert mpl.rcParams['text.usetex'] is False

lib/matplotlib/tests/test_style.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
unicode_literals)
33

44
import os
5-
import sys
65
import shutil
76
import tempfile
7+
from collections import OrderedDict
88
from contextlib import contextmanager
99

10-
from nose import SkipTest
1110
from nose.tools import assert_raises
1211
from nose.plugins.attrib import attr
1312

@@ -121,12 +120,6 @@ def test_context_with_union_of_dict_and_namedstyle():
121120

122121

123122
def test_context_with_badparam():
124-
if sys.version_info[:2] >= (2, 7):
125-
from collections import OrderedDict
126-
else:
127-
m = "Test can only be run in Python >= 2.7 as it requires OrderedDict"
128-
raise SkipTest(m)
129-
130123
original_value = 'gray'
131124
other_value = 'blue'
132125
d = OrderedDict([(PARAM, original_value), ('badparam', None)])

lib/matplotlib/tests/test_text.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import numpy as np
88
from numpy.testing import assert_almost_equal
99
from nose.tools import eq_, assert_raises
10-
from nose.plugins.skip import SkipTest
1110

1211
from matplotlib.transforms import Bbox
1312
import matplotlib
@@ -287,10 +286,6 @@ def test_get_rotation_int():
287286

288287
def test_get_rotation_raises():
289288
from matplotlib import text
290-
import sys
291-
if sys.version_info[:2] < (2, 7):
292-
raise SkipTest("assert_raises as context manager "
293-
"not supported with Python < 2.7")
294289
with assert_raises(ValueError):
295290
text.get_rotation('hozirontal')
296291

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
import nose
31
from nose.tools import assert_raises
42
from mpl_toolkits.mplot3d import Axes3D, axes3d
53
from matplotlib import cm
@@ -218,9 +216,6 @@ def test_wireframe3dzerorstride():
218216

219217
@cleanup
220218
def test_wireframe3dzerostrideraises():
221-
if sys.version_info[:2] < (2, 7):
222-
raise nose.SkipTest("assert_raises as context manager "
223-
"not supported with Python < 2.7")
224219
fig = plt.figure()
225220
ax = fig.add_subplot(111, projection='3d')
226221
X, Y, Z = axes3d.get_test_data(0.05)

0 commit comments

Comments
 (0)