X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/api_changes/deprecations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Deprecations
````````````

- `matplotlib.testing.noseclasses` is deprecated and will be removed in 2.3
4 changes: 2 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,15 +1511,15 @@ def _init_tests():
)
)

from .testing.nose import check_deps
from .testing._nose import check_deps
check_deps()


def test(verbosity=1, coverage=False, **kwargs):
"""run the matplotlib test suite"""
_init_tests()

from .testing.nose import test as nose_test
from .testing._nose import test as nose_test
return nose_test(verbosity, coverage, **kwargs)


Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def skipif(condition, *args, **kwargs):
import pytest
return pytest.mark.skipif(condition, *args, **kwargs)
else:
from .nose.decorators import skipif
from ._nose.decorators import skipif
return skipif(condition, *args, **kwargs)


Expand All @@ -65,7 +65,7 @@ def knownfailureif(fail_condition, msg=None, known_exception_class=None):
return pytest.mark.xfail(condition=fail_condition, reason=msg,
raises=known_exception_class, strict=strict)
else:
from .nose.decorators import knownfailureif
from ._nose.decorators import knownfailureif
return knownfailureif(fail_condition, msg, known_exception_class)


Expand Down Expand Up @@ -340,7 +340,7 @@ def wrapper(extension):


# sadly we cannot use fixture here because of visibility problems
# and for for obvious reason avoid `nose.tools.with_setup`
# and for for obvious reason avoid `_nose.tools.with_setup`
wrapper.setup, wrapper.teardown = self.setup, self.teardown

return wrapper
Expand Down
26 changes: 26 additions & 0 deletions lib/matplotlib/testing/noseclasses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
The module testing.noseclasses is deprecated as of 2.1
"""

from __future__ import (absolute_import, division, print_function,
unicode_literals)
try:
from ._nose.plugins.knownfailure import KnownFailure as _KnownFailure
has_nose = True
except ImportError:
has_nose = False
_KnownFailure = object

from .. import cbook

cbook.warn_deprecated(
since="2.1",
message="The noseclass module has been deprecated in 2.1 and will "
"be removed in matplotlib 2.3.")


@cbook.deprecated("2.1")
class KnownFailure(_KnownFailure):
def __init__(self):
if not has_nose:
raise ImportError("Need nose for this plugin.")
4 changes: 2 additions & 2 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ def get_packages(self):
'matplotlib.sphinxext',
'matplotlib.style',
'matplotlib.testing',
'matplotlib.testing.nose',
'matplotlib.testing.nose.plugins',
'matplotlib.testing._nose',
'matplotlib.testing._nose.plugins',
'matplotlib.testing.jpl_units',
'matplotlib.tri',
'matplotlib.cbook'
Expand Down
X Tutup