summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-02-20 20:31:49 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-02-20 20:31:49 +0000
commitd2282c8bf4e835509f3132c03d8fa841dab5e371 (patch)
treefa75d7ddc3db3db1be2e8c66366ccea6033e3d2e
parent1149a81d53ff6825048dd8dea09fb95c803a8944 (diff)
parent60f2e841c8540490abfe77f39dd8027a7ddf735b (diff)
downloadsqlalchemy-d2282c8bf4e835509f3132c03d8fa841dab5e371.tar.gz
Merge "Remove unnecessary tuple; prepare for "iterator" verbiage"
-rw-r--r--lib/sqlalchemy/orm/session.py32
-rw-r--r--test/aaa_profiling/test_misc.py2
-rw-r--r--test/profiles.txt20
3 files changed, 27 insertions, 27 deletions
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py
index 9342c3145..095033951 100644
--- a/lib/sqlalchemy/orm/session.py
+++ b/lib/sqlalchemy/orm/session.py
@@ -1190,7 +1190,7 @@ class Session(_SessionClassMethods):
The second positional argument to :meth:`.Session.execute` is an
optional parameter set. Similar to that of
:meth:`.Connection.execute`, whether this is passed as a single
- dictionary, or a list of dictionaries, determines whether the DBAPI
+ dictionary, or a sequence of dictionaries, determines whether the DBAPI
cursor's ``execute()`` or ``executemany()`` is used to execute the
statement. An INSERT construct may be invoked for a single row::
@@ -2716,7 +2716,7 @@ class Session(_SessionClassMethods):
**before using this method, and fully test and confirm the
functionality of all code developed using these systems.**
- :param objects: a list of mapped object instances. The mapped
+ :param objects: a sequence of mapped object instances. The mapped
objects are persisted as is, and are **not** associated with the
:class:`.Session` afterwards.
@@ -2769,7 +2769,7 @@ class Session(_SessionClassMethods):
def key(state):
return (state.mapper, state.key is not None)
- obj_states = tuple(attributes.instance_state(obj) for obj in objects)
+ obj_states = (attributes.instance_state(obj) for obj in objects)
if not preserve_order:
obj_states = sorted(obj_states, key=key)
@@ -2819,11 +2819,11 @@ class Session(_SessionClassMethods):
representing the single kind of object represented within the mapping
list.
- :param mappings: a list of dictionaries, each one containing the state
- of the mapped row to be inserted, in terms of the attribute names
- on the mapped class. If the mapping refers to multiple tables,
- such as a joined-inheritance mapping, each dictionary must contain
- all keys to be populated into all tables.
+ :param mappings: a sequence of dictionaries, each one containing the
+ state of the mapped row to be inserted, in terms of the attribute
+ names on the mapped class. If the mapping refers to multiple tables,
+ such as a joined-inheritance mapping, each dictionary must contain all
+ keys to be populated into all tables.
:param return_defaults: when True, rows that are missing values which
generate defaults, namely integer primary key defaults and sequences,
@@ -2910,14 +2910,14 @@ class Session(_SessionClassMethods):
representing the single kind of object represented within the mapping
list.
- :param mappings: a list of dictionaries, each one containing the state
- of the mapped row to be updated, in terms of the attribute names
- on the mapped class. If the mapping refers to multiple tables,
- such as a joined-inheritance mapping, each dictionary may contain
- keys corresponding to all tables. All those keys which are present
- and are not part of the primary key are applied to the SET clause
- of the UPDATE statement; the primary key values, which are required,
- are applied to the WHERE clause.
+ :param mappings: a sequence of dictionaries, each one containing the
+ state of the mapped row to be updated, in terms of the attribute names
+ on the mapped class. If the mapping refers to multiple tables, such
+ as a joined-inheritance mapping, each dictionary may contain keys
+ corresponding to all tables. All those keys which are present and
+ are not part of the primary key are applied to the SET clause of the
+ UPDATE statement; the primary key values, which are required, are
+ applied to the WHERE clause.
.. seealso::
diff --git a/test/aaa_profiling/test_misc.py b/test/aaa_profiling/test_misc.py
index 8326a3190..f238fe8a7 100644
--- a/test/aaa_profiling/test_misc.py
+++ b/test/aaa_profiling/test_misc.py
@@ -105,7 +105,7 @@ class CacheKeyTest(fixtures.TestBase):
for i in range(100)
]
- @profiling.function_call_count()
+ @profiling.function_call_count(variance=0.15, warmup=1)
def test_statement_one(self, stmt_fixture_one):
current_key = None
for stmt in stmt_fixture_one:
diff --git a/test/profiles.txt b/test/profiles.txt
index 043e7e5a0..501ea699e 100644
--- a/test/profiles.txt
+++ b/test/profiles.txt
@@ -1,15 +1,15 @@
# /home/classic/dev/sqlalchemy/test/profiles.txt
# This file is written out on a per-environment basis.
-# For each test in aaa_profiling, the corresponding function and
+# For each test in aaa_profiling, the corresponding function and
# environment is located within this file. If it doesn't exist,
# the test is skipped.
-# If a callcount does exist, it is compared to what we received.
+# If a callcount does exist, it is compared to what we received.
# assertions are raised if the counts do not match.
-#
-# To add a new callcount test, apply the function_call_count
-# decorator and re-run the tests using the --write-profiles
+#
+# To add a new callcount test, apply the function_call_count
+# decorator and re-run the tests using the --write-profiles
# option - this file will be rewritten including the new count.
-#
+#
# TEST: test.aaa_profiling.test_compiler.CompileTest.test_insert
@@ -138,10 +138,10 @@ test.aaa_profiling.test_compiler.CompileTest.test_update_whereclause 3.7_sqlite_
# TEST: test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one
-test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 2.7_sqlite_pysqlite_dbapiunicode_cextensions 4968
-test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 2.7_sqlite_pysqlite_dbapiunicode_nocextensions 4968
-test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 3.7_sqlite_pysqlite_dbapiunicode_cextensions 5173
-test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 3.7_sqlite_pysqlite_dbapiunicode_nocextensions 5173
+test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 2.7_sqlite_pysqlite_dbapiunicode_cextensions 4302
+test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 2.7_sqlite_pysqlite_dbapiunicode_nocextensions 4302
+test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 3.7_sqlite_pysqlite_dbapiunicode_cextensions 4903
+test.aaa_profiling.test_misc.CacheKeyTest.test_statement_one 3.7_sqlite_pysqlite_dbapiunicode_nocextensions 4903
# TEST: test.aaa_profiling.test_misc.EnumTest.test_create_enum_from_pep_435_w_expensive_members