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,
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,
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):
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.",