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

Skip to content

Commit 8d75a75

Browse files
committed
Fix for Py 2.6: some nose function did not exist
1 parent b801a83 commit 8d75a75

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/matplotlib/tests/test_style.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
from contextlib import contextmanager
99

1010
from nose import SkipTest
11-
from nose.tools import (assert_raises, assert_equal, assert_is_not,
12-
assert_is_instance)
11+
from nose.tools import assert_raises, assert_equal
1312

1413
import matplotlib as mpl
1514
from matplotlib import style
@@ -142,7 +141,7 @@ def test_context_with_badparam():
142141

143142
def test_get_style_dict():
144143
style_dict = get_style_dict('bmh')
145-
assert_is_instance(style_dict, dict)
144+
assert(isinstance(style_dict, dict))
146145

147146

148147
def test_get_style_dict_from_lib():
@@ -215,13 +214,13 @@ def test_no_parent():
215214
flattened = flatten_inheritance_dict(child, 'parents')
216215
assert_equal(flattened, child)
217216
# Verify that flatten_inheritance_dict always returns a copy.
218-
assert_is_not(flattened, child)
217+
assert(flattened is not child)
219218

220219

221220
def test_non_list_raises():
222221
child = {'parents': 'parent-value'}
223-
with assert_raises(ValueError):
224-
flatten_inheritance_dict(child, 'parents')
222+
assert_raises(ValueError, flatten_inheritance_dict, child,
223+
'parents')
225224

226225

227226
def test_child_with_no_unique_values():
@@ -278,9 +277,8 @@ def expand_parent(key):
278277
return parent_map[key]
279278

280279
child = {'parents': ['a-pointer']}
281-
with assert_raises(RuntimeError):
282-
flatten_inheritance_dict(child, 'parents',
283-
expand_parent=expand_parent)
280+
assert_raises(RuntimeError, flatten_inheritance_dict, child,
281+
'parents', expand_parent=expand_parent)
284282

285283

286284
if __name__ == '__main__':

0 commit comments

Comments
 (0)