Skip to content

Commit 3da4413

Browse files
committed
Moved exceptions that don’t depend on nose to separate file to avoid making nose a dependency for matplotlib.testing.compare
1 parent 8cf1593 commit 3da4413

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

lib/matplotlib/testing/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from __future__ import division
88

99
import matplotlib
10-
from matplotlib.testing.noseclasses import ImageComparisonFailure
10+
from matplotlib.testing.exceptions import ImageComparisonFailure
1111
from matplotlib.testing import image_util
1212
from matplotlib import _png
1313
import math

lib/matplotlib/testing/exceptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class KnownFailureTest(Exception):
2+
'''Raise this exception to mark a test as a known failing test.'''
3+
pass
4+
5+
class KnownFailureDidNotFailTest(Exception):
6+
'''Raise this exception to mark a test should have failed but did not.'''
7+
pass
8+
9+
class ImageComparisonFailure(AssertionError):
10+
'''Raise this exception to mark a test as a comparison between two images.'''

lib/matplotlib/testing/noseclasses.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
from __future__ import print_function
22
import os
33
from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
4-
5-
class KnownFailureTest(Exception):
6-
'''Raise this exception to mark a test as a known failing test.'''
7-
pass
8-
9-
class KnownFailureDidNotFailTest(Exception):
10-
'''Raise this exception to mark a test should have failed but did not.'''
11-
pass
12-
13-
class ImageComparisonFailure(AssertionError):
14-
'''Raise this exception to mark a test as a comparison between two images.'''
4+
from matplotlib.testing.exceptions import (KnownFailureTest,
5+
KnownFailureDidNotFailTest,
6+
ImageComparisonFailure)
157

168
class KnownFailure(ErrorClassPlugin):
179
'''Plugin that installs a KNOWNFAIL error class for the

0 commit comments

Comments
 (0)