5
5
6
6
import io
7
7
import os
8
- import sys
9
8
import warnings
9
+ from collections import OrderedDict
10
10
11
11
from cycler import cycler , Cycler
12
12
16
16
from matplotlib .testing .decorators import cleanup , knownfailureif
17
17
import matplotlib .colors as mcolors
18
18
from nose .tools import assert_true , assert_raises , assert_equal
19
- from nose .plugins .skip import SkipTest
20
19
import nose
21
20
from itertools import chain
22
21
import numpy as np
@@ -115,9 +114,6 @@ def test_RcParams_class():
115
114
116
115
117
116
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" )
121
117
rc = mpl .RcParams ({'figure.figsize' : (3.5 , 42 )})
122
118
bad_dict = {'figure.figsize' : (3.5 , 42 , 1 )}
123
119
# make sure validation happens on input
@@ -131,9 +127,6 @@ def test_rcparams_update():
131
127
132
128
133
129
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" )
137
130
with assert_raises (ValueError ):
138
131
with warnings .catch_warnings ():
139
132
warnings .filterwarnings ('ignore' ,
@@ -172,14 +165,6 @@ def test_Bug_2543():
172
165
mpl .rcParams ['svg.embed_char_paths' ] = False
173
166
assert_true (mpl .rcParams ['svg.fonttype' ] == "none" )
174
167
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
183
168
with assert_raises (ValueError ):
184
169
validate_bool_maybe_none ("blah" )
185
170
with assert_raises (ValueError ):
@@ -249,9 +234,6 @@ def _validation_test_helper(validator, arg, target):
249
234
250
235
251
236
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" )
255
237
with assert_raises (exception_type ):
256
238
validator (arg )
257
239
@@ -395,11 +377,6 @@ def test_rcparams_reset_after_fail():
395
377
# raised an exception due to issues in the supplied rc parameters, the
396
378
# global rc parameters were left in a modified state.
397
379
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
-
403
380
with mpl .rc_context (rc = {'text.usetex' : False }):
404
381
405
382
assert mpl .rcParams ['text.usetex' ] is False
0 commit comments