From 6976c83054c4dd03d9bb85ebb52e456343da2fbb Mon Sep 17 00:00:00 2001 From: Miklos Homolya Date: Wed, 28 Oct 2015 14:55:21 +0000 Subject: [PATCH] review fixes to test cases --- tests/regression/test_point_eval_api.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/regression/test_point_eval_api.py b/tests/regression/test_point_eval_api.py index 3bccb6b86f..7ded5bfcab 100644 --- a/tests/regression/test_point_eval_api.py +++ b/tests/regression/test_point_eval_api.py @@ -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(): @@ -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(): @@ -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)