summaryrefslogtreecommitdiff
path: root/test/orm/test_attributes.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/orm/test_attributes.py')
-rw-r--r--test/orm/test_attributes.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/orm/test_attributes.py b/test/orm/test_attributes.py
index ca8cef3ad..fa26ec7d7 100644
--- a/test/orm/test_attributes.py
+++ b/test/orm/test_attributes.py
@@ -6,7 +6,8 @@ from sqlalchemy import exc as sa_exc
from sqlalchemy.test import *
from sqlalchemy.test.testing import eq_
from test.orm import _base
-import gc
+from sqlalchemy.test.util import gc_collect
+from sqlalchemy.util import cmp, jython
# global for pickling tests
MyTest = None
@@ -80,7 +81,9 @@ class AttributesTest(_base.ORMTest):
del o2.__dict__['mt2']
o2.__dict__[o_mt2_str] = former
- self.assert_(pk_o == pk_o2)
+ # Relies on dict ordering
+ if not jython:
+ self.assert_(pk_o == pk_o2)
# the above is kind of distrurbing, so let's do it again a little
# differently. the string-id in serialization thing is just an
@@ -93,7 +96,9 @@ class AttributesTest(_base.ORMTest):
o4 = pickle.loads(pk_o3)
pk_o4 = pickle.dumps(o4)
- self.assert_(pk_o3 == pk_o4)
+ # Relies on dict ordering
+ if not jython:
+ self.assert_(pk_o3 == pk_o4)
# and lastly make sure we still have our data after all that.
# identical serialzation is great, *if* it's complete :)
@@ -117,7 +122,7 @@ class AttributesTest(_base.ORMTest):
f.bar = "foo"
assert state.dict == {'bar':'foo', state.manager.STATE_ATTR:state}
del f
- gc.collect()
+ gc_collect()
assert state.obj() is None
assert state.dict == {}