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

Skip to content

Commit 70c0990

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 44ee7f9 commit 70c0990

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
@@ -15,7 +15,7 @@
1515

1616
import matplotlib
1717
from matplotlib.compat import subprocess
18-
from matplotlib.testing.noseclasses import ImageComparisonFailure
18+
from matplotlib.testing.exceptions import ImageComparisonFailure
1919
from matplotlib import _png
2020
from matplotlib import _get_cachedir
2121
from matplotlib import cbook

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
@@ -5,17 +5,9 @@
55

66
import os
77
from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
8-
9-
class KnownFailureTest(Exception):
10-
'''Raise this exception to mark a test as a known failing test.'''
11-
pass
12-
13-
class KnownFailureDidNotFailTest(Exception):
14-
'''Raise this exception to mark a test should have failed but did not.'''
15-
pass
16-
17-
class ImageComparisonFailure(AssertionError):
18-
'''Raise this exception to mark a test as a comparison between two images.'''
8+
from matplotlib.testing.exceptions import (KnownFailureTest,
9+
KnownFailureDidNotFailTest,
10+
ImageComparisonFailure)
1911

2012
class KnownFailure(ErrorClassPlugin):
2113
'''Plugin that installs a KNOWNFAIL error class for the

0 commit comments

Comments
 (0)