Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3965858

Browse filesBrowse files
committed
Add test
1 parent 536d175 commit 3965858
Copy full SHA for 3965858

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed

‎lib/matplotlib/tests/test_transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_transforms.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,21 @@ def test_nonsingular():
561561
assert_array_equal(out, zero_expansion)
562562

563563

564+
def test_invalid_arguments():
565+
t = mtrans.Affine2D()
566+
# There are two different exceptions, since the wrong number of
567+
# dimensions is caught when constructing an array_view, and that
568+
# raises a ValueError, and a wrong shape with a possible number
569+
# of dimensions is caught by our CALL_CPP macro, which always
570+
# raises the less precise RuntimeError.
571+
assert_raises(ValueError, t.transform, 1)
572+
assert_raises(ValueError, t.transform, [[[1]]])
573+
assert_raises(RuntimeError, t.transform, [])
574+
assert_raises(RuntimeError, t.transform, [1])
575+
assert_raises(RuntimeError, t.transform, [[1]])
576+
assert_raises(RuntimeError, t.transform, [[1, 2, 3]])
577+
578+
564579
if __name__ == '__main__':
565580
import nose
566581
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.