summaryrefslogtreecommitdiff
path: root/examples/performance
diff options
context:
space:
mode:
Diffstat (limited to 'examples/performance')
-rw-r--r--examples/performance/__init__.py4
-rw-r--r--examples/performance/large_resultsets.py14
-rw-r--r--examples/performance/single_inserts.py4
3 files changed, 10 insertions, 12 deletions
diff --git a/examples/performance/__init__.py b/examples/performance/__init__.py
index f1f59026c..c6244554f 100644
--- a/examples/performance/__init__.py
+++ b/examples/performance/__init__.py
@@ -334,7 +334,7 @@ class Profiler(object):
if len(sys.argv) > 1:
potential_name = sys.argv[1]
try:
- suite = __import__(__name__ + "." + potential_name)
+ __import__(__name__ + "." + potential_name)
except ImportError:
pass
@@ -382,7 +382,7 @@ class Profiler(object):
args.profile = args.profile or args.dump or args.runsnake
if cls.name is None:
- suite = __import__(__name__ + "." + args.name)
+ __import__(__name__ + "." + args.name)
Profiler(args).run()
diff --git a/examples/performance/large_resultsets.py b/examples/performance/large_resultsets.py
index a5f99a283..b7b96453d 100644
--- a/examples/performance/large_resultsets.py
+++ b/examples/performance/large_resultsets.py
@@ -64,7 +64,7 @@ def test_orm_full_objects_list(n):
"""Load fully tracked ORM objects into one big list()."""
sess = Session(engine)
- objects = list(sess.query(Customer).limit(n))
+ list(sess.query(Customer).limit(n))
@Profiler.profile
@@ -108,7 +108,7 @@ def test_core_fetchall(n):
with engine.connect() as conn:
result = conn.execute(Customer.__table__.select().limit(n)).fetchall()
for row in result:
- data = row["id"], row["name"], row["description"]
+ row["id"], row["name"], row["description"]
@Profiler.profile
@@ -124,7 +124,7 @@ def test_core_fetchmany_w_streaming(n):
if not chunk:
break
for row in chunk:
- data = row["id"], row["name"], row["description"]
+ row["id"], row["name"], row["description"]
@Profiler.profile
@@ -138,7 +138,7 @@ def test_core_fetchmany(n):
if not chunk:
break
for row in chunk:
- data = row["id"], row["name"], row["description"]
+ row["id"], row["name"], row["description"]
@Profiler.profile
@@ -183,13 +183,11 @@ def _test_dbapi_raw(n, make_objects):
if make_objects:
for row in cursor.fetchall():
# ensure that we fully fetch!
- customer = SimpleCustomer(
- id_=row[0], name=row[1], description=row[2]
- )
+ SimpleCustomer(id_=row[0], name=row[1], description=row[2])
else:
for row in cursor.fetchall():
# ensure that we fully fetch!
- data = row[0], row[1], row[2]
+ row[0], row[1], row[2]
conn.close()
diff --git a/examples/performance/single_inserts.py b/examples/performance/single_inserts.py
index 428eb5c41..2dd87d5b6 100644
--- a/examples/performance/single_inserts.py
+++ b/examples/performance/single_inserts.py
@@ -164,7 +164,7 @@ def _test_dbapi_raw(n, connect):
conn = engine.pool._creator()
cursor = conn.cursor()
cursor.execute(sql, arg)
- lastrowid = cursor.lastrowid
+ cursor.lastrowid
conn.commit()
conn.close()
else:
@@ -172,7 +172,7 @@ def _test_dbapi_raw(n, connect):
conn = engine.raw_connection()
cursor = conn.cursor()
cursor.execute(sql, arg)
- lastrowid = cursor.lastrowid
+ cursor.lastrowid
conn.commit()
conn.close()