Skip to content

Commit

Permalink
test some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Nov 9, 2021
1 parent bd3b47b commit 238de5a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/test_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
Copyright Andrew P. Davison, 2012-2017
"""

from lazyarray import larray, sqrt, cos, power
from lazyarray import larray, sqrt, cos, power, fmod
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from nose.tools import assert_raises


def test_sqrt_from_array():
Expand Down Expand Up @@ -44,7 +45,18 @@ def clock():
decimal=15)


def testpower_from_array():
def test_power_from_array():
A = larray(np.array([1, 4, 9, 16, 25]))
assert_array_equal(power(A, 0.5).evaluate(),
np.arange(1, 6))


def test_power_with_plain_array():
A = np.array([1, 4, 9, 16, 25])
assert_array_equal(power(A, 0.5), np.arange(1, 6))


def test_fmod_with_array_as_2nd_arg():
A = larray(np.array([1, 4, 9, 16, 25]))
B = larray(np.array([1, 4, 9, 16, 25]))
assert_raises(TypeError, fmod, A, B)

0 comments on commit 238de5a

Please sign in to comment.