def test_session_noclose(self): for x in range(0, ITERATIONS): sess = create_session() t1s = sess.query(T1).filter(T1.c1.between(15, 48)).all() for index in [2, 7, 12, 15, 18, 20]: t1s[index].t2s del sess gc_collect()
def test_session_dirty(self): for x in range(0, ITERATIONS): sess = create_session() t1s = sess.query(T1).filter(T1.c1.between(15, 48)).all() for index in [2, 7, 12, 15, 18, 20]: t1s[index].c2 = 'this is some modified text' for t2 in t1s[index].t2s: t2.c2 = 'this is some modified text' del t1s gc_collect() sess.close() del sess gc_collect()