diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-05-28 19:28:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-05-28 19:28:35 +0000 |
| commit | 056bad48e2bc948a08621ab841fd882cb6934262 (patch) | |
| tree | 2635059b149309c2ad7a648bfce13fd5844d8dc8 /test/sql | |
| parent | c07979e8d44a30fdf0ea73bc587aa05a52e9955a (diff) | |
| parent | 77f1b7d236dba6b1c859bb428ef32d118ec372e6 (diff) | |
| download | sqlalchemy-056bad48e2bc948a08621ab841fd882cb6934262.tar.gz | |
Merge "callcount reductions and refinement for cached queries"
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_resultset.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py index 0eff94635..6428b7dbe 100644 --- a/test/sql/test_resultset.py +++ b/test/sql/test_resultset.py @@ -579,7 +579,7 @@ class CursorResultTest(fixtures.TablesTest): lambda r: r._getter("user"), lambda r: r.keys(), lambda r: r.columns("user"), - lambda r: r.cursor_strategy.fetchone(r), + lambda r: r.cursor_strategy.fetchone(r, r.cursor), ]: trans = conn.begin() result = conn.execute(users.insert(), user_id=1) @@ -2130,8 +2130,21 @@ class AlternateCursorResultTest(fixtures.TablesTest): self.table = self.tables.test class ExcCtx(default.DefaultExecutionContext): - def get_result_cursor_strategy(self, result): - return cls.create(result) + def post_exec(self): + if cls is _cursor.CursorFetchStrategy: + pass + elif cls is _cursor.BufferedRowCursorFetchStrategy: + self.cursor_fetch_strategy = cls( + self.cursor, self.execution_options + ) + elif cls is _cursor.FullyBufferedCursorFetchStrategy: + self.cursor_fetch_strategy = cls( + self.cursor, + self.cursor.description, + self.cursor.fetchall(), + ) + else: + assert False self.patcher = patch.object( self.engine.dialect, "execution_ctx_cls", ExcCtx |
