예제 #1
0
def test_binaryop(op, arg1, arg2):
    carg1 = convert(arg1)
    wrapper1 = MetabiosisWrapper(carg1)
    carg2 = convert(arg2)
    wrapper2 = MetabiosisWrapper(carg2)
    result = op(wrapper1, wrapper2)
    if isinstance(result, MetabiosisWrapper):
        result = pypy_convert(result)
    expected = op(arg1, arg2)
    assert result == expected
def test_binaryop(op, arg1, arg2):
    carg1 = convert(arg1)
    wrapper1 = MetabiosisWrapper(carg1)
    carg2 = convert(arg2)
    wrapper2 = MetabiosisWrapper(carg2)
    result = op(wrapper1, wrapper2)
    if isinstance(result, MetabiosisWrapper):
        result = pypy_convert(result)
    expected = op(arg1, arg2)
    assert result == expected
예제 #3
0
def test_unaryop(op, input):
    cinput = convert(input)
    wrapper = MetabiosisWrapper(cinput)
    result = op(wrapper)
    if isinstance(result, MetabiosisWrapper):
        result = pypy_convert(result)
    expected = op(input)
    assert result == expected
def test_unaryop(op, input):
    cinput = convert(input)
    wrapper = MetabiosisWrapper(cinput)
    result = op(wrapper)
    if isinstance(result, MetabiosisWrapper):
        result = pypy_convert(result)
    expected = op(input)
    assert result == expected