summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_reflection.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-05-30 11:31:03 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-06-20 13:50:41 -0400
commit190e0139e834e4271268652e058c280787ae69eb (patch)
tree21e93907a58cd2f390f687ddc5e0c1da1eb25454 /test/dialect/postgresql/test_reflection.py
parentff8e7732b9f656f8cea05544660c18d57dd37864 (diff)
downloadsqlalchemy-190e0139e834e4271268652e058c280787ae69eb.tar.gz
Enable F841
This is a very useful assertion which prevents unused variables from being set up allows code to be more readable and sometimes even more efficient. test suites seem to be where the most problems are and there do not seem to be documentation examples that are using this, or at least the linter is not taking effect within rst blocks. Change-Id: I2b3341d8dd14da34879d8425838e66a4b9f8e27d
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r--test/dialect/postgresql/test_reflection.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py
index 9580018be..7e7a82d46 100644
--- a/test/dialect/postgresql/test_reflection.py
+++ b/test/dialect/postgresql/test_reflection.py
@@ -49,7 +49,7 @@ class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults):
"sqla_testing", "postgres_test_db_link"
)
- testtable = Table(
+ Table(
"testtable",
metadata,
Column("id", Integer, primary_key=True),
@@ -86,13 +86,13 @@ class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults):
def test_get_foreign_table_names(self):
inspector = inspect(testing.db)
- with testing.db.connect() as conn:
+ with testing.db.connect():
ft_names = inspector.get_foreign_table_names()
eq_(ft_names, ["test_foreigntable"])
def test_get_table_names_no_foreign(self):
inspector = inspect(testing.db)
- with testing.db.connect() as conn:
+ with testing.db.connect():
names = inspector.get_table_names()
eq_(names, ["testtable"])
@@ -450,7 +450,7 @@ class ReflectionTest(fixtures.TestBase):
@testing.provide_metadata
def test_renamed_sequence_reflection(self):
metadata = self.metadata
- t = Table("t", metadata, Column("id", Integer, primary_key=True))
+ Table("t", metadata, Column("id", Integer, primary_key=True))
metadata.create_all()
m2 = MetaData(testing.db)
t2 = Table("t", m2, autoload=True, implicit_returning=False)
@@ -472,7 +472,7 @@ class ReflectionTest(fixtures.TestBase):
@testing.provide_metadata
def test_altered_type_autoincrement_pk_reflection(self):
metadata = self.metadata
- t = Table(
+ Table(
"t",
metadata,
Column("id", Integer, primary_key=True),
@@ -490,7 +490,7 @@ class ReflectionTest(fixtures.TestBase):
@testing.provide_metadata
def test_renamed_pk_reflection(self):
metadata = self.metadata
- t = Table("t", metadata, Column("id", Integer, primary_key=True))
+ Table("t", metadata, Column("id", Integer, primary_key=True))
metadata.create_all()
testing.db.connect().execution_options(autocommit=True).execute(
"alter table t rename id to t_id"
@@ -705,9 +705,7 @@ class ReflectionTest(fixtures.TestBase):
m1 = MetaData(conn)
- t1_schema = Table(
- "some_table", m1, schema="test_schema", autoload=True
- )
+ Table("some_table", m1, schema="test_schema", autoload=True)
t2_schema = Table(
"some_other_table", m1, schema="test_schema_2", autoload=True
)
@@ -855,7 +853,7 @@ class ReflectionTest(fixtures.TestBase):
metadata = self.metadata
- t1 = Table(
+ Table(
"party",
metadata,
Column("id", String(10), nullable=False),
@@ -994,7 +992,7 @@ class ReflectionTest(fixtures.TestBase):
metadata = self.metadata
- t1 = Table(
+ Table(
"t",
metadata,
Column("id", Integer, primary_key=True),