diff options
| author | Jay Bourque <jay.bourque@continuum.io> | 2013-04-17 18:07:31 -0500 |
|---|---|---|
| committer | Jay Bourque <jay.bourque@continuum.io> | 2013-04-26 12:44:32 -0500 |
| commit | d73fb730ec3f91e9805b9c8b909ea22b8b4fe6b6 (patch) | |
| tree | 114857fe1c82f5bc36eaa43012a62a423ab03162 /numpy | |
| parent | ecb041694a97fa070ef8c9b3b60b5522ab4ac2cb (diff) | |
| download | numpy-d73fb730ec3f91e9805b9c8b909ea22b8b4fe6b6.tar.gz | |
Add another test for ufunc custom output type
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/tests/test_ufunc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py index d63f12de7..66e2544eb 100644 --- a/numpy/core/tests/test_ufunc.py +++ b/numpy/core/tests/test_ufunc.py @@ -778,9 +778,13 @@ class TestUfunc(TestCase): a = np.array([0, 1, 2], dtype='i8') b = np.array([0, 1, 2], dtype='i8') c = np.empty(3, dtype=rational.rational) + # output must be specified so numpy knows what ufunc signature to look for result = rational.test_add(a, b, c) assert_equal(result, np.array([0, 2, 4], dtype=rational.rational)) + # no output type should raise TypeError + assert_raises(TypeError, rational.test_add, a, b) + if __name__ == "__main__": run_module_suite() |
