summaryrefslogtreecommitdiff
path: root/test/sql/test_constraints.py
diff options
context:
space:
mode:
authorKhairi Hafsham <jumanjisama@gmail.com>2017-02-02 13:02:21 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-02-07 11:21:56 -0500
commit772374735da27df1ddb907f4a0f5085b46dbe82b (patch)
tree41f88c835a74d4665c97853ae8676a5181d61db3 /test/sql/test_constraints.py
parentd71f4b47186972c5248c94ee2d04364da95a0965 (diff)
downloadsqlalchemy-772374735da27df1ddb907f4a0f5085b46dbe82b.tar.gz
Make all tests to be PEP8 compliant
tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
Diffstat (limited to 'test/sql/test_constraints.py')
-rw-r--r--test/sql/test_constraints.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py
index efd52ffb5..aebbb4c30 100644
--- a/test/sql/test_constraints.py
+++ b/test/sql/test_constraints.py
@@ -10,7 +10,10 @@ from sqlalchemy.engine import default
from sqlalchemy.testing import engines
from sqlalchemy.testing.assertions import expect_warnings
from sqlalchemy.testing import eq_
-from sqlalchemy.testing.assertsql import AllOf, RegexSQL, CompiledSQL, DialectSQL
+from sqlalchemy.testing.assertsql import (AllOf,
+ RegexSQL,
+ CompiledSQL,
+ DialectSQL)
from sqlalchemy.sql import table, column
@@ -451,11 +454,6 @@ class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
),
)
-
-
-
-
-
@testing.requires.check_constraints
@testing.provide_metadata
def test_check_constraint_create(self):
@@ -616,11 +614,11 @@ class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
RegexSQL("^CREATE TABLE events"),
AllOf(
CompiledSQL('CREATE UNIQUE INDEX ix_events_name ON events '
- '(name)'),
+ '(name)'),
CompiledSQL('CREATE INDEX ix_events_location ON events '
- '(location)'),
+ '(location)'),
CompiledSQL('CREATE UNIQUE INDEX sport_announcer ON events '
- '(sport, announcer)'),
+ '(sport, announcer)'),
CompiledSQL('CREATE INDEX idx_winners ON events (winner)'),
)
)
@@ -828,11 +826,11 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
)
def test_deferrable_pk(self):
- factory = lambda **kw: PrimaryKeyConstraint('a', **kw)
+ def factory(**kw): return PrimaryKeyConstraint('a', **kw)
self._test_deferrable(factory)
def test_deferrable_table_fk(self):
- factory = lambda **kw: ForeignKeyConstraint(['b'], ['tbl.a'], **kw)
+ def factory(**kw): return ForeignKeyConstraint(['b'], ['tbl.a'], **kw)
self._test_deferrable(factory)
def test_deferrable_column_fk(self):
@@ -896,11 +894,11 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
)
def test_deferrable_unique(self):
- factory = lambda **kw: UniqueConstraint('b', **kw)
+ def factory(**kw): return UniqueConstraint('b', **kw)
self._test_deferrable(factory)
def test_deferrable_table_check(self):
- factory = lambda **kw: CheckConstraint('a < b', **kw)
+ def factory(**kw): return CheckConstraint('a < b', **kw)
self._test_deferrable(factory)
def test_multiple(self):
@@ -1148,5 +1146,3 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
schema.CreateIndex(constraint),
"CREATE INDEX name ON tbl (a + 5)"
)
-
-