|
8 | 8 | from contextlib import contextmanager |
9 | 9 |
|
10 | 10 | 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 |
13 | 12 |
|
14 | 13 | import matplotlib as mpl |
15 | 14 | from matplotlib import style |
@@ -142,7 +141,7 @@ def test_context_with_badparam(): |
142 | 141 |
|
143 | 142 | def test_get_style_dict(): |
144 | 143 | style_dict = get_style_dict('bmh') |
145 | | - assert_is_instance(style_dict, dict) |
| 144 | + assert(isinstance(style_dict, dict)) |
146 | 145 |
|
147 | 146 |
|
148 | 147 | def test_get_style_dict_from_lib(): |
@@ -215,13 +214,13 @@ def test_no_parent(): |
215 | 214 | flattened = flatten_inheritance_dict(child, 'parents') |
216 | 215 | assert_equal(flattened, child) |
217 | 216 | # Verify that flatten_inheritance_dict always returns a copy. |
218 | | - assert_is_not(flattened, child) |
| 217 | + assert(flattened is not child) |
219 | 218 |
|
220 | 219 |
|
221 | 220 | def test_non_list_raises(): |
222 | 221 | 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') |
225 | 224 |
|
226 | 225 |
|
227 | 226 | def test_child_with_no_unique_values(): |
@@ -278,9 +277,8 @@ def expand_parent(key): |
278 | 277 | return parent_map[key] |
279 | 278 |
|
280 | 279 | 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) |
284 | 282 |
|
285 | 283 |
|
286 | 284 | if __name__ == '__main__': |
|
0 commit comments