From: Mike Bayer Date: Sat, 20 Apr 2013 09:34:40 +0000 (-0400) Subject: - these pickle the assoc proxy by itself tests can't really pass X-Git-Tag: rel_0_8_1~12^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae1e8996165ea3efd29996e010b760c921a20a8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - these pickle the assoc proxy by itself tests can't really pass now without strong ref on the parent - fix message compare for py3k --- diff --git a/test/ext/test_associationproxy.py b/test/ext/test_associationproxy.py index 5bec0ad1db..c15b98bf2f 100644 --- a/test/ext/test_associationproxy.py +++ b/test/ext/test_associationproxy.py @@ -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): diff --git a/test/orm/test_instrumentation.py b/test/orm/test_instrumentation.py index 3f8fc67b68..3c564d910b 100644 --- a/test/orm/test_instrumentation.py +++ b/test/orm/test_instrumentation.py @@ -453,7 +453,7 @@ class MapperInitTest(fixtures.ORMTest): assert_raises_message( sa.exc.SAWarning, r"__del__\(\) method on class " - " will cause " + " will cause " "unreachable cycles and memory leaks, as SQLAlchemy " "instrumentation often creates reference cycles. " "Please remove this method.",