def test_fail(self): x = complex64() y = int32() try: x % y assert False except ComplexError: pass
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)
def test_mod_complex_fail(): # Make sure % fails on complex numbers. x = complex64() y = int32() with pytest.raises(ComplexError): x % y