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

Skip to content

Commit 2c31f97

Browse files
committed
Moved tests from cbook to tests_cbook
1 parent cb98e6f commit 2c31f97

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

lib/matplotlib/cbook.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def unicode_safe(s):
7777
return unicode(s, preferredencoding)
7878

7979

80-
class converter:
80+
class converter(object):
8181
"""
8282
Base class for handling string -> python type with support for
8383
missing values
@@ -580,7 +580,8 @@ def get_sample_data(fname, asfileobj=True):
580580
if matplotlib.rcParams['examples.directory']:
581581
root = matplotlib.rcParams['examples.directory']
582582
else:
583-
root = os.path.join(os.path.dirname(__file__), "mpl-data", "sample_data")
583+
root = os.path.join(os.path.dirname(__file__),
584+
"mpl-data", "sample_data")
584585
path = os.path.join(root, fname)
585586

586587
if asfileobj:
@@ -1820,11 +1821,3 @@ def _check_output(*popenargs, **kwargs):
18201821
check_output = subprocess.check_output
18211822
else:
18221823
check_output = _check_output
1823-
1824-
1825-
if __name__ == '__main__':
1826-
assert(allequal([1, 1, 1]))
1827-
assert(not allequal([1, 1, 0]))
1828-
assert(allequal([]))
1829-
assert(allequal(('a', 'a')))
1830-
assert(not allequal(('a', 'b')))

lib/matplotlib/tests/test_cbook.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,9 @@ def test_rgba(self):
7878
assert_array_equal(actual[1], expected[1])
7979

8080

81+
def test_allequal():
82+
assert(cbook.allequal([1, 1, 1]))
83+
assert(not cbook.allequal([1, 1, 0]))
84+
assert(cbook.allequal([]))
85+
assert(cbook.allequal(('a', 'a')))
86+
assert(not cbook.allequal(('a', 'b')))

0 commit comments

Comments
 (0)