Exemplo n.º 1
0
 def test_fail(self):
     x = complex64()
     y = int32()
     try:
         x % y
         assert False
     except ComplexError:
         pass
Exemplo n.º 2
0
 def test_fail(self):
     x = complex64()
     y = int32()
     try:
         x % y
         assert False
     except ComplexError:
         pass
Exemplo n.º 3
0
    def test_0(self):
        a = int8()
        b = int32()
        c = complex64()
        d = float64()
        f = float32()

        assert isinstance((a // b).owner.op, IntDiv)
        assert isinstance((b // a).owner.op, IntDiv)
        assert isinstance((b / d).owner.op, TrueDiv)
        assert isinstance((b / f).owner.op, TrueDiv)
        assert isinstance((f / a).owner.op, TrueDiv)
        assert isinstance((d / b).owner.op, TrueDiv)
        assert isinstance((d / f).owner.op, TrueDiv)
        assert isinstance((f / c).owner.op, TrueDiv)
        assert isinstance((a / c).owner.op, TrueDiv)
Exemplo n.º 4
0
    def test_0(self):
        a = int8()
        b = int32()
        c = complex64()
        d = float64()
        f = float32()

        assert isinstance((a // b).owner.op, IntDiv)
        assert isinstance((b // a).owner.op, IntDiv)
        assert isinstance((b / d).owner.op, TrueDiv)
        assert isinstance((b / f).owner.op, TrueDiv)
        assert isinstance((f / a).owner.op, TrueDiv)
        assert isinstance((d / b).owner.op, TrueDiv)
        assert isinstance((d / f).owner.op, TrueDiv)
        assert isinstance((f / c).owner.op, TrueDiv)
        assert isinstance((a / c).owner.op, TrueDiv)
Exemplo n.º 5
0
def test_mod_complex_fail():
    # Make sure % fails on complex numbers.
    x = complex64()
    y = int32()
    with pytest.raises(ComplexError):
        x % y