8000 Replace `raise KnownFailureTest` with `raise SkipTest` · matplotlib/matplotlib@dd5ef04 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd5ef04

Browse files
committed
Replace raise KnownFailureTest with raise SkipTest
1 parent 239e5f0 commit dd5ef04

File tree

6 files changed

+11
-16
lines changed

6 files changed

+11
-16
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def remove_text(figure):
214214
def test(self):
215215
baseline_dir, result_dir = _image_directories(self._func)
216216
if self._style != 'classic':
217-
raise KnownFailureTest('temporarily disabled until 2.0 tag')
217+
from nose.plugins.skip import SkipTest
218+
raise SkipTest('temporarily disabled until 2.0 tag')
218219
for fignum, baseline in zip(plt.get_fignums(), self._baseline_images):
219220
for extension in self._extensions:
220221
will_fail = not extension in comparable_formats()

lib/matplotlib/tests/test_animation.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
from numpy.testing import assert_equal
1111
from nose import with_setup
1212
from nose.tools import assert_false, assert_true
13+
from nose.plugins.skip import SkipTest
1314
import matplotlib as mpl
1415
from matplotlib import pyplot as plt
1516
from matplotlib import animation
16-
from matplotlib.testing.noseclasses import KnownFailureTest
1717
from matplotlib.testing.decorators import cleanup
1818
from matplotlib.testing.decorators import CleanupTest
1919

@@ -113,8 +113,7 @@ def test_save_animation_smoketest():
113113
@cleanup
114114
def check_save_animation(writer, extension='mp4'):
115115
if not animation.writers.is_available(writer):
116-
raise KnownFailureTest("writer '%s' not available on this system"
117-
% writer)
116+
raise SkipTest("writer '%s' not available on this system" % writer)
118117
fig, ax = plt.subplots()
119118
line, = ax.plot([], [])
120119

@@ -138,9 +137,8 @@ def animate(i):
138137
try:
139138
anim.save(F.name, fps=30, writer=writer, bitrate=500)
140139
except UnicodeDecodeError:
141-
raise KnownFailureTest("There can be errors in the numpy " +
142-
"import stack, " +
143-
"see issues #1891 and #2679")
140+
raise SkipTest("There can be errors in the numpy import stack, "
141+
"see issues #1891 and #2679")
144142
finally:
145143
try:
146144
os.remove(F.name)

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import matplotlib
2525
from matplotlib.testing.decorators import image_comparison, cleanup
26-
from matplotlib.testing.noseclasses import KnownFailureTest
2726
import matplotlib.pyplot as plt
2827
import matplotlib.markers as mmarkers
2928
import matplotlib.patches as mpatches
@@ -90,7 +89,7 @@ def test_formatter_ticker():
9089
@image_comparison(baseline_images=["formatter_large_small"])
9190
def test_formatter_large_small():
9291
if LooseVersion(np.__version__) >= LooseVersion('1.11.0'):
93-
raise KnownFailureTest("Fall out from a fixed numpy bug")
92+
raise SkipTest("Fall out from a fixed numpy bug")
9493
# github issue #617, pull #619
9594
fig, ax = plt.subplots(1)
9695
x = [0.500000001, 0.500000002]

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from matplotlib.testing.compare import compare_images, ImageComparisonFailure
1818
from matplotlib.testing.decorators import (_image_directories, switch_backend,
1919
cleanup)
20-
from matplotlib.testing.noseclasses import KnownFailureTest
2120

2221
baseline_dir, result_dir = _image_directories(lambda: 'dummy func')
2322

@@ -44,7 +43,7 @@ def check_for(texsystem):
4443

4544
def compare_figure(fname, savefig_kwargs={}, tol=0):
4645
# TODO remove this before tagging 2.0
47-
raise KnownFailureTest('temporarily disabled until 2.0 tag')
46+
raise SkipTest('temporarily disabled until 2.0 tag')
4847
actual = os.path.join(result_dir, fname)
4948
plt.savefig(actual, **savefig_kwargs)
5049

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from nose.tools import assert_equal
88
from nose.plugins.skip import SkipTest
9-
from matplotlib.testing.noseclasses import KnownFailureTest
109

1110
try:
1211
import pep8
@@ -257,9 +256,9 @@ def test_pep8_conformance_examples():
257256
fp, tail = os.path.split(fp)
258257

259258
if mpldir is None:
260-
raise KnownFailureTest("can not find the examples, set env "
261-
"MPL_REPO_DIR to point to the top-level path "
262-
"of the source tree")
259+
raise SkipTest("can not find the examples, set env "
260+
"MPL_REPO_DIR to point to the top-level path "
261+
"of the source tree")
263262

264263
exdir = os.path.join(mpldir, 'examples')
265264
blacklist = ()

lib/matplotlib/tests/test_image.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from nose.tools import assert_raises
2323
from numpy.testing import (
2424
assert_array_equal, assert_array_almost_equal, assert_allclose)
25-
from matplotlib.testing.noseclasses import KnownFailureTest
2625
from copy import copy
2726
from numpy import ma
2827
import matplotlib.colors as colors

0 commit comments

Comments
 (0)
0