summaryrefslogtreecommitdiff
path: root/test/dialect/mysql/test_for_update.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 01:14:26 -0500
committermike bayer <mike_mp@zzzcomputing.com>2019-01-06 17:34:50 +0000
commit1e1a38e7801f410f244e4bbb44ec795ae152e04e (patch)
tree28e725c5c8188bd0cfd133d1e268dbca9b524978 /test/dialect/mysql/test_for_update.py
parent404e69426b05a82d905cbb3ad33adafccddb00dd (diff)
downloadsqlalchemy-1e1a38e7801f410f244e4bbb44ec795ae152e04e.tar.gz
Run black -l 79 against all source files
This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
Diffstat (limited to 'test/dialect/mysql/test_for_update.py')
-rw-r--r--test/dialect/mysql/test_for_update.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/test/dialect/mysql/test_for_update.py b/test/dialect/mysql/test_for_update.py
index a8cbcfb87..197c9d693 100644
--- a/test/dialect/mysql/test_for_update.py
+++ b/test/dialect/mysql/test_for_update.py
@@ -15,15 +15,15 @@ from sqlalchemy import testing
class MySQLForUpdateLockingTest(fixtures.DeclarativeMappedTest):
__backend__ = True
- __only_on__ = 'mysql'
- __requires__ = 'mysql_for_update',
+ __only_on__ = "mysql"
+ __requires__ = ("mysql_for_update",)
@classmethod
def setup_classes(cls):
Base = cls.DeclarativeBasic
class A(Base):
- __tablename__ = 'a'
+ __tablename__ = "a"
id = Column(Integer, primary_key=True)
x = Column(Integer)
y = Column(Integer)
@@ -31,9 +31,9 @@ class MySQLForUpdateLockingTest(fixtures.DeclarativeMappedTest):
__table_args__ = {"mysql_engine": "InnoDB"}
class B(Base):
- __tablename__ = 'b'
+ __tablename__ = "b"
id = Column(Integer, primary_key=True)
- a_id = Column(ForeignKey('a.id'))
+ a_id = Column(ForeignKey("a.id"))
x = Column(Integer)
y = Column(Integer)
__table_args__ = {"mysql_engine": "InnoDB"}
@@ -48,7 +48,7 @@ class MySQLForUpdateLockingTest(fixtures.DeclarativeMappedTest):
s.add_all(
[
A(x=5, y=5, bs=[B(x=4, y=4), B(x=2, y=8), B(x=7, y=1)]),
- A(x=7, y=5, bs=[B(x=4, y=4), B(x=5, y=8)])
+ A(x=7, y=5, bs=[B(x=4, y=4), B(x=5, y=8)]),
]
)
s.commit()
@@ -70,9 +70,7 @@ class MySQLForUpdateLockingTest(fixtures.DeclarativeMappedTest):
alt_trans.execute("set innodb_lock_wait_timeout=1")
# set x/y > 10
try:
- alt_trans.execute(
- update(A).values(x=15, y=19)
- )
+ alt_trans.execute(update(A).values(x=15, y=19))
except (exc.InternalError, exc.OperationalError) as err:
assert "Lock wait timeout exceeded" in str(err)
assert should_be_locked
@@ -85,9 +83,7 @@ class MySQLForUpdateLockingTest(fixtures.DeclarativeMappedTest):
alt_trans.execute("set innodb_lock_wait_timeout=1")
# set x/y > 10
try:
- alt_trans.execute(
- update(B).values(x=15, y=19)
- )
+ alt_trans.execute(update(B).values(x=15, y=19))
except (exc.InternalError, exc.OperationalError) as err:
assert "Lock wait timeout exceeded" in str(err)
assert should_be_locked