From 8aa6a24fbb1244724906d613b6f9b3cb18751ee8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 8 Oct 2006 02:51:30 +0000 Subject: [PATCH] this test works better with session clears in between --- test/orm/mapper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/orm/mapper.py b/test/orm/mapper.py index 27c92e437b..fad13b5c0a 100644 --- a/test/orm/mapper.py +++ b/test/orm/mapper.py @@ -366,6 +366,8 @@ class MapperTest(MapperSuperTest): l = usermapper.query(sess).select() self.assert_result(l, User, *user_address_result) self.assert_sql_count(db, go, 1) + + sess.clear() # then select just from users. run it into instances. # then assert the data, which will launch 3 more lazy loads @@ -377,6 +379,8 @@ class MapperTest(MapperSuperTest): self.assert_sql_count(db, go, 4) clear_mappers() + + sess.clear() # test with a deeper set of eager loads. when we first load the three # users, they will have no addresses or orders. the number of lazy loads when @@ -393,6 +397,8 @@ class MapperTest(MapperSuperTest): }), lazy=False) }) + sess.clear() + # first test straight eager load, 1 statement def go(): l = usermapper.query(sess).select() -- 2.47.2