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

Skip to content

Commit d828f53

Browse files
committed
FIX ensure backward compatibility
1 parent 5365270 commit d828f53

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

lib/matplotlib/testing/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import matplotlib
99
from matplotlib.cbook import is_string_like, iterable
1010
from matplotlib import rcParams, rcdefaults, use
11+
# For backward compatibility
12+
from . import noseclasses
1113

1214

1315
def _is_list_like(obj):

lib/matplotlib/testing/noseclasses.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
The module testing.noseclasses is deprecated as of 2.1
3+
"""
4+
5+
from __future__ import (absolute_import, division, print_function,
6+
unicode_literals)
7+
try:
8+
from ._nose.plugins.knownfailure import KnownFailure as _KnownFailure
9+
has_nose = True
10+
except ImportError:
11+
has_nose = False
12+
_KnownFailure = object
13+
14+
from .. import cbook
15+
16+
cbook.warn_deprecated(
17+
since="2.1",
18+
message="The noseclass module has been deprecated in 2.1 and will "
19+
"be removed in matplotlib 2.3.")
20+
21+
22+
@cbook.deprecated("2.1")
23+
class KnownFailure(_KnownFailure):
24+
def __init__(self):
25+
if not has_nose:
26+
raise ImportError("Need nose for this plugin.")
27+
pass

0 commit comments

Comments
 (0)