summaryrefslogtreecommitdiff
path: root/test/aaa_profiling
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-06-04 17:29:20 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-10-01 16:52:24 -0400
commitcc718cccc0bf8a01abdf4068c7ea4f32c9322af6 (patch)
treee839526dd0ab64bf0d8babe01006e03987403a66 /test/aaa_profiling
parenta3c964203e61f8deeb559b15a78cc640dee67012 (diff)
downloadsqlalchemy-cc718cccc0bf8a01abdf4068c7ea4f32c9322af6.tar.gz
Run row value processors up front
as part of a larger series of changes to generalize row-tuples, RowProxy becomes plain Row and is no longer a "proxy"; the DBAPI row is now copied directly into the Row when constructed, result handling occurs at once. Subsequent changes will break out Row into a new version that behaves fully a tuple. Change-Id: I2ffa156afce5d21c38f28e54c3a531f361345dd5
Diffstat (limited to 'test/aaa_profiling')
-rw-r--r--test/aaa_profiling/test_memusage.py14
-rw-r--r--test/aaa_profiling/test_resultset.py17
2 files changed, 21 insertions, 10 deletions
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py
index 56d8b4ff8..cbfbc63ee 100644
--- a/test/aaa_profiling/test_memusage.py
+++ b/test/aaa_profiling/test_memusage.py
@@ -84,7 +84,18 @@ def profile_memory(
if until_maxtimes >= maxtimes // 5:
break
for x in range(5):
- func(*func_args)
+ try:
+ func(*func_args)
+ except Exception as err:
+ queue.put(
+ (
+ "result",
+ False,
+ "Test raised an exception: %r" % err,
+ )
+ )
+
+ raise
gc_collect()
samples.append(
get_num_objects()
@@ -910,6 +921,7 @@ class MemUsageWBackendTest(EnsureZeroed):
metadata.drop_all()
assert_no_mappers()
+ @testing.expect_deprecated
@testing.provide_metadata
def test_key_fallback_result(self):
e = self.engine
diff --git a/test/aaa_profiling/test_resultset.py b/test/aaa_profiling/test_resultset.py
index 8085d5e23..51fcbde65 100644
--- a/test/aaa_profiling/test_resultset.py
+++ b/test/aaa_profiling/test_resultset.py
@@ -8,7 +8,7 @@ from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy import Unicode
-from sqlalchemy.engine.result import RowProxy
+from sqlalchemy.engine.result import Row
from sqlalchemy.testing import AssertsExecutionResults
from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
@@ -149,11 +149,11 @@ class ExecutionTest(fixtures.TestBase):
go()
-class RowProxyTest(fixtures.TestBase):
+class RowTest(fixtures.TestBase):
__requires__ = ("cpython",)
__backend__ = True
- def _rowproxy_fixture(self, keys, processors, row):
+ def _rowproxy_fixture(self, keys, processors, row, row_cls):
class MockMeta(object):
def __init__(self):
pass
@@ -161,13 +161,11 @@ class RowProxyTest(fixtures.TestBase):
metadata = MockMeta()
keymap = {}
- for index, (keyobjs, processor, values) in enumerate(
- list(zip(keys, processors, row))
- ):
+ for index, (keyobjs, values) in enumerate(list(zip(keys, row))):
for key in keyobjs:
- keymap[key] = (processor, key, index)
- keymap[index] = (processor, key, index)
- return RowProxy(metadata, row, processors, keymap)
+ keymap[key] = (index, key)
+ keymap[index] = (index, key)
+ return row_cls(metadata, processors, keymap, row)
def _test_getitem_value_refcounts(self, seq_factory):
col1, col2 = object(), object()
@@ -180,6 +178,7 @@ class RowProxyTest(fixtures.TestBase):
[(col1, "a"), (col2, "b")],
[proc1, None],
seq_factory([value1, value2]),
+ Row,
)
v1_refcount = sys.getrefcount(value1)