Skip to content

Commit

Permalink
review fixes to test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
miklos1 committed Oct 28, 2015
1 parent e2d3d14 commit 6976c83
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/regression/test_point_eval_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ def test_dont_raise():
f.at(-1)

# dont_raise=True
assert 'None' == str(f.at(-1, dont_raise=True))
assert '[None, array(0.0), array(1.0)]' == str(f.at([-1, 0, 0.5], dont_raise=True))
assert f.at(-1, dont_raise=True) is None

actual = f.at([-1, 0, 0.5], dont_raise=True)
assert actual[0] is None
assert np.allclose([0.0, 1.0], actual[1:])


def test_dont_raise_vector():
Expand All @@ -100,8 +103,11 @@ def test_dont_raise_vector():
f.at(-1)

# dont_raise=True
assert 'None' == str(f.at(-1, dont_raise=True))
assert '[None, array([ 1., 2.])]' == str(f.at([-1, 1], dont_raise=True))
assert f.at(-1, dont_raise=True) is None

actual = f.at([-1, 1], dont_raise=True)
assert actual[0] is None
assert np.allclose([1.0, 2.0], actual[1])


def test_dont_raise_mixed():
Expand All @@ -119,7 +125,7 @@ def test_dont_raise_mixed():
f.at([1.2, 0.5])

# dont_raise=True
assert 'None' == str(f.at([1.2, 0.5], dont_raise=True))
assert f.at([1.2, 0.5], dont_raise=True) is None


@pytest.mark.parallel(nprocs=3)
Expand Down

0 comments on commit 6976c83

Please sign in to comment.