summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-03-17 12:32:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-03-17 12:32:33 -0400
commitb7e151ac5cf5a0c13b9a30bc6841ed0cfe322536 (patch)
tree039e129fb13d3fbafd2dcc718c15a5a2ea85a49f /test/sql
parent2cadd768aa48d1180e24600cf133586a343ea10b (diff)
downloadsqlalchemy-b7e151ac5cf5a0c13b9a30bc6841ed0cfe322536.tar.gz
- The "auto close" for :class:`.ResultProxy` is now a "soft" close.
That is, after exhausing all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if :meth:`.ResultProxy.close` is called explicitly will these methods raise the "result is closed" error. fixes #3330 fixes #3329
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_query.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index eeec487be..08afc3256 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -993,6 +993,9 @@ class QueryTest(fixtures.TestBase):
def test_fetchone_til_end(self):
result = testing.db.execute("select * from query_users")
eq_(result.fetchone(), None)
+ eq_(result.fetchone(), None)
+ eq_(result.fetchone(), None)
+ result.close()
assert_raises_message(
exc.ResourceClosedError,
"This result object is closed.",