summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-09-28 14:08:59 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-09-28 15:17:26 -0400
commitc3f102c9fe9811fd5286628cc6aafa5fbc324621 (patch)
tree4a78723089ded623701667de1eee21d22edbe6c1 /test/dialect/postgresql
parent75ac0abc7d5653d10006769a881374a46b706db5 (diff)
downloadsqlalchemy-c3f102c9fe9811fd5286628cc6aafa5fbc324621.tar.gz
upgrade to black 20.8b1
It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
Diffstat (limited to 'test/dialect/postgresql')
-rw-r--r--test/dialect/postgresql/test_compiler.py15
-rw-r--r--test/dialect/postgresql/test_dialect.py8
-rw-r--r--test/dialect/postgresql/test_reflection.py6
-rw-r--r--test/dialect/postgresql/test_types.py20
4 files changed, 32 insertions, 17 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 64e945124..eaa5597d0 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -1267,7 +1267,9 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
)
self.assert_compile(
- c.any(5), "%(param_1)s = ANY (x)", checkparams={"param_1": 5},
+ c.any(5),
+ "%(param_1)s = ANY (x)",
+ checkparams={"param_1": 5},
)
self.assert_compile(
@@ -1277,7 +1279,9 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
)
self.assert_compile(
- c.all(5), "%(param_1)s = ALL (x)", checkparams={"param_1": 5},
+ c.all(5),
+ "%(param_1)s = ALL (x)",
+ checkparams={"param_1": 5},
)
self.assert_compile(
@@ -2300,8 +2304,7 @@ class DistinctOnTest(fixtures.TestBase, AssertsCompiledSQL):
class FullTextSearchTest(fixtures.TestBase, AssertsCompiledSQL):
- """Tests for full text searching
- """
+ """Tests for full text searching"""
__dialect__ = postgresql.dialect()
@@ -2322,8 +2325,8 @@ class FullTextSearchTest(fixtures.TestBase, AssertsCompiledSQL):
def _raise_query(self, q):
"""
- useful for debugging. just do...
- self._raise_query(q)
+ useful for debugging. just do...
+ self._raise_query(q)
"""
c = q.compile(dialect=postgresql.dialect())
raise ValueError(c)
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index 971d4f12f..43c5aea21 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -473,7 +473,8 @@ class ExecutemanyValuesInsertsTest(ExecuteManyMode, fixtures.TablesTest):
assert t.c.id not in result.keys()
assert not result._soft_closed
assert isinstance(
- result.cursor_strategy, _cursor.FullyBufferedCursorFetchStrategy,
+ result.cursor_strategy,
+ _cursor.FullyBufferedCursorFetchStrategy,
)
assert not result.cursor.closed
assert not result.closed
@@ -1020,7 +1021,10 @@ $$ LANGUAGE plpgsql;
eq_(
conn.scalar(
select(
- cast(literal(quoted_name("some_name", False)), String,)
+ cast(
+ literal(quoted_name("some_name", False)),
+ String,
+ )
)
),
"some_name",
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py
index b8de35f42..2c6795719 100644
--- a/test/dialect/postgresql/test_reflection.py
+++ b/test/dialect/postgresql/test_reflection.py
@@ -900,8 +900,7 @@ class ReflectionTest(AssertsCompiledSQL, fixtures.TestBase):
@testing.provide_metadata
def test_index_reflection(self):
- """ Reflecting expression-based indexes should warn
- """
+ """Reflecting expression-based indexes should warn"""
metadata = self.metadata
@@ -953,8 +952,7 @@ class ReflectionTest(AssertsCompiledSQL, fixtures.TestBase):
@testing.provide_metadata
def test_index_reflection_partial(self, connection):
- """Reflect the filter defintion on partial indexes
- """
+ """Reflect the filter defintion on partial indexes"""
metadata = self.metadata
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index 5def5aa5b..509603e1b 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -1436,7 +1436,9 @@ class ArrayRoundTripTest(object):
stmt = select(
func.array_cat(
- array([1, 2, 3]), array([4, 5, 6]), type_=self.ARRAY(Integer),
+ array([1, 2, 3]),
+ array([4, 5, 6]),
+ type_=self.ARRAY(Integer),
)[2:5]
)
eq_(connection.execute(stmt).scalar(), [2, 3, 4, 5])
@@ -1879,7 +1881,10 @@ class ArrayEnum(fixtures.TestBase):
c = "ccc"
tbl.append_column(
- Column("pyenum_col", array_cls(enum_cls(MyEnum)),),
+ Column(
+ "pyenum_col",
+ array_cls(enum_cls(MyEnum)),
+ ),
)
self.metadata.create_all(connection)
@@ -1918,7 +1923,10 @@ class ArrayJSON(fixtures.TestBase):
"json_table",
self.metadata,
Column("id", Integer, primary_key=True),
- Column("json_col", array_cls(json_cls),),
+ Column(
+ "json_col",
+ array_cls(json_cls),
+ ),
)
self.metadata.create_all(connection)
@@ -2166,7 +2174,8 @@ class SpecialTypesTest(fixtures.TablesTest, ComparesTables):
connection.execute(t.update(), data="'a' 'cat' 'fat' 'mat' 'sat'")
eq_(
- connection.scalar(select(t.c.data)), "'a' 'cat' 'fat' 'mat' 'sat'",
+ connection.scalar(select(t.c.data)),
+ "'a' 'cat' 'fat' 'mat' 'sat'",
)
@testing.provide_metadata
@@ -3227,7 +3236,8 @@ class JSONRoundTripTest(fixtures.TablesTest):
def _test_insert_none_as_null(self, conn):
conn.execute(
- self.tables.data_table.insert(), {"name": "r1", "nulldata": None},
+ self.tables.data_table.insert(),
+ {"name": "r1", "nulldata": None},
)
self._assert_column_is_NULL(conn, column="nulldata")