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

Skip to content

Commit a0c9759

Browse files
committed
TST: conditionally import assert_sequence_equal
This is not available in the version of nose available for py2.6.
1 parent c78ca18 commit a0c9759

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
from distutils.version import LooseVersion as V
77

88
from nose.tools import assert_raises, assert_equal, assert_true
9-
from nose.tools import assert_sequence_equal
9+
10+
try:
11+
# this is not available in nose + py2.6
12+
from nose.tools import assert_sequence_equal
13+
except ImportError:
14+
assert_sequence_equal = None
1015

1116
import numpy as np
1217
from numpy.testing.utils import assert_array_equal, assert_array_almost_equal
@@ -565,7 +570,8 @@ def test_pandas_iterable():
565570
import pandas as pd
566571
except ImportError:
567572
raise SkipTest("Pandas not installed")
568-
573+
if assert_sequence_equal is None:
574+
raise SkipTest("nose lacks required function")
569575
# Using a list or series yields equivalent
570576
# color maps, i.e the series isn't seen as
571577
# a single color

0 commit comments

Comments
 (0)