]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- these pickle the assoc proxy by itself tests can't really pass
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Apr 2013 09:34:40 +0000 (05:34 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Apr 2013 09:34:40 +0000 (05:34 -0400)
now without strong ref on the parent
- fix message compare for py3k

test/ext/test_associationproxy.py
test/orm/test_instrumentation.py

index 5bec0ad1dba8535d9f98f2da4bcd5791bbded710..c15b98bf2fd99e8561e8675553430c3b6079e37e 100644 (file)
@@ -971,8 +971,10 @@ class ReconstitutionTest(fixtures.TestBase):
         p.kids.extend(['c1', 'c2'])
         r1 = pickle.loads(pickle.dumps(p))
         assert r1.kids == ['c1', 'c2']
-        r2 = pickle.loads(pickle.dumps(p.kids))
-        assert r2 == ['c1', 'c2']
+
+        # can't do this without parent having a cycle
+        #r2 = pickle.loads(pickle.dumps(p.kids))
+        #assert r2 == ['c1', 'c2']
 
     def test_pickle_set(self):
         mapper(Parent, self.parents,
@@ -983,8 +985,10 @@ class ReconstitutionTest(fixtures.TestBase):
         p.kids.update(['c1', 'c2'])
         r1 = pickle.loads(pickle.dumps(p))
         assert r1.kids == set(['c1', 'c2'])
-        r2 = pickle.loads(pickle.dumps(p.kids))
-        assert r2 == set(['c1', 'c2'])
+
+        # can't do this without parent having a cycle
+        #r2 = pickle.loads(pickle.dumps(p.kids))
+        #assert r2 == set(['c1', 'c2'])
 
     def test_pickle_dict(self):
         mapper(Parent, self.parents,
@@ -997,8 +1001,10 @@ class ReconstitutionTest(fixtures.TestBase):
         assert p.kids == {'c1': 'c1', 'c2': 'c2'}
         r1 = pickle.loads(pickle.dumps(p))
         assert r1.kids == {'c1': 'c1', 'c2': 'c2'}
-        r2 = pickle.loads(pickle.dumps(p.kids))
-        assert r2 == {'c1': 'c1', 'c2': 'c2'}
+
+        # can't do this without parent having a cycle
+        #r2 = pickle.loads(pickle.dumps(p.kids))
+        #assert r2 == {'c1': 'c1', 'c2': 'c2'}
 
 class PickleKeyFunc(object):
     def __init__(self, name):
index 3f8fc67b68b4ea70b6a08b600bdc03534438d7b4..3c564d910bca8124d5d20adebe93faa5d8a7e90f 100644 (file)
@@ -453,7 +453,7 @@ class MapperInitTest(fixtures.ORMTest):
         assert_raises_message(
             sa.exc.SAWarning,
             r"__del__\(\) method on class "
-            "<class 'test.orm.test_instrumentation.A'> will cause "
+            "<class '.*\.A'> will cause "
             "unreachable cycles and memory leaks, as SQLAlchemy "
             "instrumentation often creates reference cycles.  "
             "Please remove this method.",