summaryrefslogtreecommitdiff
path: root/test/sql/test_utils.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/sql/test_utils.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/sql/test_utils.py')
-rw-r--r--test/sql/test_utils.py60
1 files changed, 20 insertions, 40 deletions
diff --git a/test/sql/test_utils.py b/test/sql/test_utils.py
index bd8368cd2..bc124ada9 100644
--- a/test/sql/test_utils.py
+++ b/test/sql/test_utils.py
@@ -9,34 +9,17 @@ from sqlalchemy.sql import util as sql_util
class CompareClausesTest(fixtures.TestBase):
def setup(self):
m = MetaData()
- self.a = Table(
- 'a', m,
- Column('x', Integer),
- Column('y', Integer)
- )
+ self.a = Table("a", m, Column("x", Integer), Column("y", Integer))
- self.b = Table(
- 'b', m,
- Column('y', Integer),
- Column('z', Integer)
- )
+ self.b = Table("b", m, Column("y", Integer), Column("z", Integer))
def test_compare_clauselist_associative(self):
- l1 = and_(
- self.a.c.x == self.b.c.y,
- self.a.c.y == self.b.c.z
- )
+ l1 = and_(self.a.c.x == self.b.c.y, self.a.c.y == self.b.c.z)
- l2 = and_(
- self.a.c.y == self.b.c.z,
- self.a.c.x == self.b.c.y,
- )
+ l2 = and_(self.a.c.y == self.b.c.z, self.a.c.x == self.b.c.y)
- l3 = and_(
- self.a.c.x == self.b.c.z,
- self.a.c.y == self.b.c.y
- )
+ l3 = and_(self.a.c.x == self.b.c.z, self.a.c.y == self.b.c.y)
is_true(l1.compare(l1))
is_true(l1.compare(l2))
@@ -45,35 +28,33 @@ class CompareClausesTest(fixtures.TestBase):
def test_compare_clauselist_not_associative(self):
l1 = ClauseList(
- self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.sub)
+ self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.sub
+ )
l2 = ClauseList(
- self.b.c.y, self.a.c.x, self.a.c.y, operator=operators.sub)
+ self.b.c.y, self.a.c.x, self.a.c.y, operator=operators.sub
+ )
is_true(l1.compare(l1))
is_false(l1.compare(l2))
def test_compare_clauselist_assoc_different_operator(self):
- l1 = and_(
- self.a.c.x == self.b.c.y,
- self.a.c.y == self.b.c.z
- )
+ l1 = and_(self.a.c.x == self.b.c.y, self.a.c.y == self.b.c.z)
- l2 = or_(
- self.a.c.y == self.b.c.z,
- self.a.c.x == self.b.c.y,
- )
+ l2 = or_(self.a.c.y == self.b.c.z, self.a.c.x == self.b.c.y)
is_false(l1.compare(l2))
def test_compare_clauselist_not_assoc_different_operator(self):
l1 = ClauseList(
- self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.sub)
+ self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.sub
+ )
l2 = ClauseList(
- self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.div)
+ self.a.c.x, self.a.c.y, self.b.c.y, operator=operators.div
+ )
is_false(l1.compare(l2))
@@ -83,9 +64,11 @@ class CompareClausesTest(fixtures.TestBase):
b3 = bindparam("bar", type_=Integer())
b4 = bindparam("foo", type_=String())
- def c1(): return 5
+ def c1():
+ return 5
- def c2(): return 6
+ def c2():
+ return 6
b5 = bindparam("foo", type_=Integer(), callable_=c1)
b6 = bindparam("foo", type_=Integer(), callable_=c2)
@@ -114,7 +97,4 @@ class MiscTest(fixtures.TestBase):
class MyElement(ColumnElement):
pass
- eq_(
- sql_util.find_tables(MyElement(), check_columns=True),
- []
- )
+ eq_(sql_util.find_tables(MyElement(), check_columns=True), [])