- close the result here for non refcounting gcs

This commit is contained in:
Mike Bayer
2011-04-23 12:10:56 -07:00
parent 02fa8bacaa
commit e1ec48b6d9
+9 -4
View File
@@ -1830,22 +1830,27 @@ class ExecutionOptionsTest(QueryTest):
q3_options = dict(foo='not bar', stream_results=True, answer=42)
assert q3._execution_options == q3_options
def test_options_in_connection(self):
User = self.classes.User
execution_options = dict(foo='bar', stream_results=True)
class TQuery(Query):
def instances(self, result, ctx):
eq_(
result.connection._execution_options,
execution_options
)
try:
eq_(
result.connection._execution_options,
execution_options
)
finally:
result.close()
return iter([])
sess = create_session(bind=testing.db, autocommit=False, query_cls=TQuery)
q1 = sess.query(User).execution_options(**execution_options)
q1.all()
class OptionsTest(QueryTest):
"""Test the _get_paths() method of PropertyOption."""