55
66import io
77import os
8- import sys
98import warnings
9+ from collections import OrderedDict
1010
1111from cycler import cycler , Cycler
1212
1616from matplotlib .testing .decorators import cleanup , knownfailureif
1717import matplotlib .colors as mcolors
1818from nose .tools import assert_true , assert_raises , assert_equal
19- from nose .plugins .skip import SkipTest
2019import nose
2120from itertools import chain
2221import numpy as np
@@ -115,9 +114,6 @@ def test_RcParams_class():
115114
116115
117116def 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
133129def 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
251236def _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
0 commit comments