summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/orm/test_attributes.py4
-rw-r--r--test/orm/test_expire.py10
2 files changed, 8 insertions, 6 deletions
diff --git a/test/orm/test_attributes.py b/test/orm/test_attributes.py
index f3a6f7d8e..de44e4be3 100644
--- a/test/orm/test_attributes.py
+++ b/test/orm/test_attributes.py
@@ -294,6 +294,7 @@ class AttributesTest(fixtures.ORMTest):
assert state.obj() is None
assert state.dict == {}
+ @testing.requires.predictable_gc
def test_object_dereferenced_error(self):
class Foo(object):
pass
@@ -317,7 +318,8 @@ class AttributesTest(fixtures.ORMTest):
)
def test_deferred(self):
- class Foo(object):pass
+ class Foo(object):
+ pass
data = {'a':'this is a', 'b':12}
def loader(state, keys):
diff --git a/test/orm/test_expire.py b/test/orm/test_expire.py
index 6eb124cd2..0ee677157 100644
--- a/test/orm/test_expire.py
+++ b/test/orm/test_expire.py
@@ -850,11 +850,11 @@ class ExpireTest(_fixtures.FixtureTest):
assert len(u.addresses) == 3
sess.expire(u)
assert 'addresses' not in u.__dict__
- print("-------------------------------------------")
sess.query(User).filter_by(id=8).all()
assert 'addresses' in u.__dict__
assert len(u.addresses) == 3
+ @testing.requires.predictable_gc
def test_expire_all(self):
users, Address, addresses, User = (self.tables.users,
self.classes.Address,
@@ -869,16 +869,16 @@ class ExpireTest(_fixtures.FixtureTest):
sess = create_session()
userlist = sess.query(User).order_by(User.id).all()
- assert self.static.user_address_result == userlist
- assert len(list(sess)) == 9
+ eq_(self.static.user_address_result, userlist)
+ eq_(len(list(sess)), 9)
sess.expire_all()
gc_collect()
- assert len(list(sess)) == 4 # since addresses were gc'ed
+ eq_(len(list(sess)), 4) # since addresses were gc'ed
userlist = sess.query(User).order_by(User.id).all()
u = userlist[1]
eq_(self.static.user_address_result, userlist)
- assert len(list(sess)) == 9
+ eq_(len(list(sess)), 9)
def test_state_change_col_to_deferred(self):
"""Behavioral test to verify the current activity of loader callables."""