Commits

Philip Jenvey  committed c0a21ff

test against py3's pow behavior

  • Participants
  • Parent commits 25e7ce4
  • Branches py3k

Comments (0)

Files changed (1)

File pypy/objspace/std/test/test_floatobject.py

         assert v.floatval == x ** y
         f1 = fobj.W_FloatObject(-1.23)
         f2 = fobj.W_FloatObject(-4.56)
-        self.space.raises_w(self.space.w_ValueError,
-                            fobj.pow__Float_Float_ANY,
-                            self.space, f1, f2,
-                            self.space.w_None)
+        v = fobj.pow__Float_Float_ANY(self.space, f1, f2, self.space.w_None)
+        assert self.space.isinstance_w(v, self.space.w_complex)
         x = -10
         y = 2.0
         f1 = fobj.W_FloatObject(x)
         assert espeq(pw(4.0, 0.5), 2.0)
         assert pw(4.0, 0) == 1.0
         assert pw(-4.0, 0) == 1.0
-        raises(ValueError, pw, -1.0, 0.5)
+        assert type(pw(-1.0, 0.5)) == complex
         assert pw(-1.0, 2.0) == 1.0
         assert pw(-1.0, 3.0) == -1.0
         assert pw(-1.0, 1e200) == 1.0