Skip to content
Browse files

Moved tests from cbook to tests_cbook

  • Loading branch information...
1 parent 282aeaf commit 1c97376377eae76dca2caea35cc414860d76cdba @NelleV committed
Showing with 9 additions and 12 deletions.
  1. +3 −12 lib/matplotlib/cbook.py
  2. +6 −0 lib/matplotlib/tests/test_cbook.py
View
15 lib/matplotlib/cbook.py
@@ -28,7 +28,6 @@
import numpy.ma as ma
-
import types
@@ -77,7 +76,7 @@ def unicode_safe(s):
return unicode(s, preferredencoding)
-class converter:
+class converter(object):
"""
Base class for handling string -> python type with support for
missing values
@@ -580,7 +579,8 @@ def get_sample_data(fname, asfileobj=True):
if matplotlib.rcParams['examples.directory']:
root = matplotlib.rcParams['examples.directory']
else:
- root = os.path.join(os.path.dirname(__file__), "mpl-data", "sample_data")
+ root = os.path.join(os.path.dirname(__file__),
+ "mpl-data", "sample_data")
path = os.path.join(root, fname)
if asfileobj:
@@ -830,7 +830,6 @@ def append(self, x):
if len(self.data) == self.max:
self.cur = 0
# Permanently change self's class from non-full to full
- # FIXME __Full is not defined
self.__class__ = __Full
def get(self):
@@ -1820,11 +1819,3 @@ def _check_output(*popenargs, **kwargs):
check_output = subprocess.check_output
else:
check_output = _check_output
-
-
-if __name__ == '__main__':
- assert(allequal([1, 1, 1]))
- assert(not allequal([1, 1, 0]))
- assert(allequal([]))
- assert(allequal(('a', 'a')))
- assert(not allequal(('a', 'b')))
View
6 lib/matplotlib/tests/test_cbook.py
@@ -78,3 +78,9 @@ def test_rgba(self):
assert_array_equal(actual[1], expected[1])
+def test_allequal():
+ assert(cbook.allequal([1, 1, 1]))
+ assert(not cbook.allequal([1, 1, 0]))
+ assert(cbook.allequal([]))
+ assert(cbook.allequal(('a', 'a')))
+ assert(not cbook.allequal(('a', 'b')))

0 comments on commit 1c97376

Please sign in to comment.
Something went wrong with that request. Please try again.