def test_array_to_json(target, expected): actual = _encoders.array_to_json(target) np.testing.assert_equal(actual, expected) actual = _encoders.array_to_json(np.array(target)) np.testing.assert_equal(actual, expected)
def test_array_to_json_exception(): with pytest.raises(TypeError): _encoders.array_to_json(lambda x: 3)