From: Mike Bayer Date: Sat, 23 Apr 2011 19:10:56 +0000 (-0700) Subject: - close the result here for non refcounting gcs X-Git-Tag: rel_0_7_0~33^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1ec48b6d9bc63ce450a932dca7a6718b38ddc71;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - close the result here for non refcounting gcs --- diff --git a/test/orm/test_query.py b/test/orm/test_query.py index 3a60e878d3..915e9a13d0 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -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."""