def test_neg(self): x = 42 f1 = iobj.W_IntObject(x) v = iobj.neg__Int(self.space, f1) assert v.intval == -x x = -sys.maxint-1 f1 = iobj.W_IntObject(x) assert self.space.w_OverflowError == ( self._unwrap_nonimpl(iobj.neg__Int, self.space, f1))
def test_neg(self): x = 42 f1 = iobj.W_IntObject(x) v = iobj.neg__Int(self.space, f1) assert v.intval == -x x = -sys.maxint - 1 f1 = iobj.W_IntObject(x) assert self.space.w_OverflowError == (self._unwrap_nonimpl( iobj.neg__Int, self.space, f1))