else:
# no connection arguments whatsoever; psycopg2.connect()
# requires that "dsn" be present as a blank string.
- return ([''], opts)
+ return ([""], opts)
def is_disconnect(self, e, connection, cursor):
if isinstance(e, self.dbapi.Error):
return (
entity.is_aliased_class
and not entity._use_mapper_path
- and (
- given is entity
- or given in entity._with_polymorphic_entities
- )
+ and (given is entity or given in entity._with_polymorphic_entities)
)
elif not entity.is_aliased_class:
return given.common_parent(entity.mapper)
toremove = set(
chain(*[_expand_cloned(f._hide_froms) for f in clauses])
)
- idx = [
- i for i in idx if clauses[i] not in toremove
- ]
+ idx = [i for i in idx if clauses[i] not in toremove]
# onclause was given and none of them resolved, so assume
# all indexes can match
)
q = select(
- [table1.c.myid, sql.literal('bar').label('c1')],
- order_by=[table1.c.name + '-']
+ [table1.c.myid, sql.literal("bar").label("c1")],
+ order_by=[table1.c.name + "-"],
).alias("foo")
crit = q.c.myid == table1.c.myid
dialect = mssql.dialect()
"myid, ? AS c1 FROM mytable) AS foo, mytable WHERE "
"foo.myid = mytable.myid",
dialect=dialect,
- checkparams={'param_1': 'bar'},
+ checkparams={"param_1": "bar"},
# if name_1 is included, too many parameters are passed to dbapi
- checkpositional=('bar', )
+ checkpositional=("bar",),
)
def test_force_schema_quoted_name_w_dot_case_insensitive(self):
dialect = psycopg2_dialect.dialect()
u = url.make_url("postgresql://")
cargs, cparams = dialect.create_connect_args(u)
- eq_(cargs, [''])
+ eq_(cargs, [""])
eq_(cparams, {})
def test_psycopg2_nonempty_connection_string(self):