From: <pj...@us...> - 2009-05-03 21:39:17
|
Revision: 6290 http://jython.svn.sourceforge.net/jython/?rev=6290&view=rev Author: pjenvey Date: 2009-05-03 21:39:08 +0000 (Sun, 03 May 2009) Log Message: ----------- make runnable on CPython, cleanup Modified Paths: -------------- trunk/jython/Lib/test/test_list_jy.py Modified: trunk/jython/Lib/test/test_list_jy.py =================================================================== --- trunk/jython/Lib/test/test_list_jy.py 2009-05-03 20:56:51 UTC (rev 6289) +++ trunk/jython/Lib/test/test_list_jy.py 2009-05-03 21:39:08 UTC (rev 6290) @@ -1,5 +1,8 @@ import unittest -import test.test_support +from test import test_support +if test_support.is_jython: + from java.util import ArrayList + from java.lang import String class ListTestCase(unittest.TestCase): @@ -21,21 +24,21 @@ self.assert_(bar2 > bar1) self.assert_(bar2 >= bar1) - #From http://bugs.jython.org/issue600790 def test_setget_override(self): - from java.util import ArrayList - from java.lang import String + if not test_support.is_jython: + return - class GoofyListMapThing (ArrayList): + # http://bugs.jython.org/issue600790 + class GoofyListMapThing(ArrayList): def __init__(self): self.silly = "Nothing" - + def __setitem__(self, key, element): self.silly = "spam" - + def __getitem__(self, key): self.silly = "eggs" - + glmt = GoofyListMapThing() glmt['my-key'] = String('el1') self.assertEquals(glmt.silly, "spam") @@ -44,9 +47,9 @@ def test_tuple_equality(self): self.assertEqual([(1,), [1]].count([1]), 1) # http://bugs.jython.org/issue1317 - + def test_main(): - test.test_support.run_unittest(ListTestCase) + test_support.run_unittest(ListTestCase) if __name__ == "__main__": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |