@pytest.mark.parametrize((u'expr', u'result'), [((lambda x, y: (x + y)), 5.0), ((lambda x, y: (x - y)), (-1.0)), ((lambda x, y: (x * y)), 6.0), ((lambda x, y: (x / y)), (2.0 / 3.0)), ((lambda x, y: (x ** y)), 8.0)])
def test_two_model_instance_arithmetic_1d(expr, result):
 s = expr(Const1D(2), Const1D(3))
 assert isinstance(s, Model)
 assert (s.n_inputs == 1)
 assert (s.n_outputs == 1)
 out = s(0)
 assert (out == result)
 assert isinstance(out, float)

@ pytest . mark . parametrize ( ( u'expr' , u'result' ) , [ ( ( lambda x , y : ( x + y ) ) , 5.0 ) , ( ( lambda x , y : ( x - y ) ) , ( - 1.0 ) ) , ( ( lambda x , y : ( x * y ) ) , 6.0 ) , ( ( lambda x , y : ( x / y ) ) , ( 2.0 / 3.0 ) ) , ( ( lambda x , y : ( x ** y ) ) , 8.0 ) ] ) def test_two_model_instance_arithmetic_1d ( expr , result ) : s = expr ( Const1D ( 2 ) , Const1D ( 3 ) ) assert isinstance ( s , Model ) assert ( s . n_inputs == 1 ) assert ( s . n_outputs == 1 ) out = s ( 0 ) assert ( out == result ) assert isinstance ( out , float )
like test_two_model_class_arithmetic_1d .