[Jython-checkins] jython: Update test_new.py

frank.wierzbicki jython-checkins at python.org
Tue Mar 20 22:33:17 CET 2012


http://hg.python.org/jython/rev/d29e2ff56a9c
changeset:   6440:d29e2ff56a9c
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Tue Mar 20 14:33:09 2012 -0700
summary:
  Update test_new.py

files:
  Lib/test/test_new.py |  12 ++++++++++--
  1 files changed, 10 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -24,10 +24,18 @@
         c = new.instance(C, {'yolks': 3})
 
         o = new.instance(C)
-        self.assertEqual(o.__dict__, {}, "new __dict__ should be empty")
+
+        # __dict__ is a non dict mapping in Jython
+        if test_support.is_jython:
+            self.assertEqual(len(o.__dict__), 0, "new __dict__ should be empty")
+        else:
+            self.assertEqual(o.__dict__, {}, "new __dict__ should be empty")
         del o
         o = new.instance(C, None)
-        self.assertEqual(o.__dict__, {}, "new __dict__ should be empty")
+        if test_support.is_jython:
+            self.assertEqual(len(o.__dict__), 0, "new __dict__ should be empty")
+        else:
+            self.assertEqual(o.__dict__, {}, "new __dict__ should be empty")
         del o
 
         def break_yolks(self):

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list