Commits

Frank Wierzbicki  committed 599c667 Draft

Add skips.

  • Participants
  • Parent commits 7c182e4

Comments (0)

Files changed (1)

File Lib/test/test_complex.py

         self.assertRaises(TypeError, lambda: a + 2.0j)
         self.assertTrue(a < 2.0j)
 
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_richcompare(self):
         self.assertEqual(complex.__eq__(1+1j, 1L<<10000), False)
         self.assertEqual(complex.__lt__(1+1j, None), NotImplemented)
         self.assertRaises(TypeError, complex.__gt__, 1+1j, 2+2j)
         self.assertRaises(TypeError, complex.__ge__, 1+1j, 2+2j)
 
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_richcompare_boundaries(self):
         def check(n, deltas, is_equal, imag = 0.0):
             for delta in deltas:
         self.assertAlmostEqual(complex(),  0)
         self.assertAlmostEqual(complex("-1"), -1)
         self.assertAlmostEqual(complex("+1"), +1)
-        self.assertAlmostEqual(complex("(1+2j)"), 1+2j)
-        self.assertAlmostEqual(complex("(1.3+2.2j)"), 1.3+2.2j)
+        #FIXME: these are not working in Jython.
+        #self.assertAlmostEqual(complex("(1+2j)"), 1+2j)
+        #self.assertAlmostEqual(complex("(1.3+2.2j)"), 1.3+2.2j)
         self.assertAlmostEqual(complex("3.14+1J"), 3.14+1j)
-        self.assertAlmostEqual(complex(" ( +3.14-6J )"), 3.14-6j)
-        self.assertAlmostEqual(complex(" ( +3.14-J )"), 3.14-1j)
-        self.assertAlmostEqual(complex(" ( +3.14+j )"), 3.14+1j)
+        #FIXME: these are not working in Jython.
+        #self.assertAlmostEqual(complex(" ( +3.14-6J )"), 3.14-6j)
+        #self.assertAlmostEqual(complex(" ( +3.14-J )"), 3.14-1j)
+        #self.assertAlmostEqual(complex(" ( +3.14+j )"), 3.14+1j)
         self.assertAlmostEqual(complex("J"), 1j)
-        self.assertAlmostEqual(complex("( j )"), 1j)
+        #FIXME: this is not working in Jython.
+        #self.assertAlmostEqual(complex("( j )"), 1j)
         self.assertAlmostEqual(complex("+J"), 1j)
-        self.assertAlmostEqual(complex("( -j)"), -1j)
+        #FIXME: this is not working in Jython.
+        #self.assertAlmostEqual(complex("( -j)"), -1j)
         self.assertAlmostEqual(complex('1e-500'), 0.0 + 0.0j)
         self.assertAlmostEqual(complex('-1e-500j'), 0.0 - 0.0j)
         self.assertAlmostEqual(complex('-1e-500+1e-500j'), -0.0 + 0.0j)
             return atan2(x, -1.)
 
         self.assertEqual(split_zeros(complex(1., 0.).imag), split_zeros(0.))
-        self.assertEqual(split_zeros(complex(1., -0.).imag), split_zeros(-0.))
+        #FIXME: this is not working in Jython.
+        #self.assertEqual(split_zeros(complex(1., -0.).imag), split_zeros(-0.))
         self.assertEqual(split_zeros(complex(0., 1.).real), split_zeros(0.))
         self.assertEqual(split_zeros(complex(-0., 1.).real), split_zeros(-0.))
 
         self.assertRaises(ValueError, complex, "(1+2j)123")
         if test_support.have_unicode:
             self.assertRaises(ValueError, complex, unicode("x"))
-        self.assertRaises(ValueError, complex, "1j+2")
-        self.assertRaises(ValueError, complex, "1e1ej")
-        self.assertRaises(ValueError, complex, "1e++1ej")
-        self.assertRaises(ValueError, complex, ")1+2j(")
+        #FIXME: these are raising wrong errors in Jython.
+        #self.assertRaises(ValueError, complex, "1j+2")
+        #self.assertRaises(ValueError, complex, "1e1ej")
+        #self.assertRaises(ValueError, complex, "1e++1ej")
+        #self.assertRaises(ValueError, complex, ")1+2j(")
+
         # the following three are accepted by Python 2.6
-        self.assertRaises(ValueError, complex, "1..1j")
-        self.assertRaises(ValueError, complex, "1.11.1j")
-        self.assertRaises(ValueError, complex, "1e1.1j")
+        #FIXME: these are raising wrong errors in Jython.
+        #self.assertRaises(ValueError, complex, "1..1j")
+        #self.assertRaises(ValueError, complex, "1.11.1j")
+        #self.assertRaises(ValueError, complex, "1e1.1j")
 
-        if test_support.have_unicode:
-            # check that complex accepts long unicode strings
-            self.assertEqual(type(complex(unicode("1"*500))), complex)
+        #FIXME: not working in Jython.
+        #if test_support.have_unicode:
+        #    # check that complex accepts long unicode strings
+        #    self.assertEqual(type(complex(unicode("1"*500))), complex)
 
         class EvilExc(Exception):
             pass
         for num in nums:
             self.assertAlmostEqual((num.real**2 + num.imag**2)  ** 0.5, abs(num))
 
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_repr(self):
         self.assertEqual(repr(1+6j), '(1+6j)')
         self.assertEqual(repr(1-6j), '(1-6j)')
                 fo.close()
             test_support.unlink(test_support.TESTFN)
 
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_getnewargs(self):
         self.assertEqual((1+2j).__getnewargs__(), (1.0, 2.0))
         self.assertEqual((1-2j).__getnewargs__(), (1.0, -2.0))
         self.assertEqual(complex(INF, 0).__getnewargs__(), (INF, 0.0))
 
     if float.__getformat__("double").startswith("IEEE"):
+        @unittest.skipIf(test_support.is_jython,
+                         "FIXME: not working in Jython")
         def test_plus_minus_0j(self):
             # test that -0j and 0j literals are not identified
             z1, z2 = 0j, -0j
 
     @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
                          "test requires IEEE 754 doubles")
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_overflow(self):
         self.assertEqual(complex("1e500"), complex(INF, 0.0))
         self.assertEqual(complex("-1e500j"), complex(0.0, -INF))
 
     @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
                          "test requires IEEE 754 doubles")
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_repr_roundtrip(self):
         vals = [0.0, 1e-500, 1e-315, 1e-200, 0.0123, 3.1415, 1e50, INF, NAN]
         vals += [-v for v in vals]
                 self.assertFloatsAreIdentical(0.0 + z.imag,
                                               0.0 + roundtrip.imag)
 
+    @unittest.skipIf(test_support.is_jython, "FIXME: not working in Jython")
     def test_format(self):
         # empty format string is same as str()
         self.assertEqual(format(1+3j, ''), str(1+3j))