from .engine import engine_from_config # noqa nosort
-__version__ = '1.3.1'
+__version__ = "1.3.1"
def __go(lcls):
# but use case-insensitive matching for these two modes in any case.
if self._casing in (1, 2):
+
def lower(s):
return s.lower()
+
else:
# if on case sensitive, there can be two tables referenced
# with the same name different casing, so we need to use
raise sa_exc.InvalidRequestError(
"Incorrect names of values in identifier to formulate "
"primary key for query.get(); primary key attribute names"
- " are %s" % ",".join(
+ " are %s"
+ % ",".join(
"'%s'" % prop.key
for prop in mapper._identity_key_props
)
def visit_bindparam(bindparam):
bindparam.unique = False
+
visitors.traverse(criterion, {}, {"bindparam": visit_bindparam})
def visit_bindparam(bindparam):
# TODO: this still wont cover if the code example itself has blank
# lines in it, need to detect those via indentation.
lines.append(line)
- lines.append(doclines.pop(0)) # the blank line following a code example
+ lines.append(
+ doclines.pop(0)
+ ) # the blank line following a code example
continue
lines.append(line)
)
def test_comparison(self):
- components = ('drivername', 'username', 'password', 'host',
- 'database', 'query', 'port')
+ components = (
+ "drivername",
+ "username",
+ "password",
+ "host",
+ "database",
+ "query",
+ "port",
+ )
- common_url = "dbtype://username:password" \
- "@[2001:da8:2004:1000:202:116:160:90]:80/database?foo=bar"
+ common_url = (
+ "dbtype://username:password"
+ "@[2001:da8:2004:1000:202:116:160:90]:80/database?foo=bar"
+ )
other_url = "dbtype://uname:pwd@host/"
url1 = url.make_url(common_url)
is_false(url1 == url3)
for curr_component in components:
- setattr(url2, curr_component, 'new_changed_value')
+ setattr(url2, curr_component, "new_changed_value")
is_true(url1 != url2)
is_false(url1 == url2)
setattr(url2, curr_component, getattr(url1, curr_component))
def test_timeout_accessor(self):
expected_timeout = 123
- p = self._queuepool_fixture(
- timeout=expected_timeout)
+ p = self._queuepool_fixture(timeout=expected_timeout)
eq_(p.timeout(), expected_timeout)
@testing.requires.timing_intensive
[call.pending_to_persistent(sess, u1), call.flag_checked(u1)],
)
- u1.name = 'u2'
+ u1.name = "u2"
sess.flush()
# event was not called again
s = Session()
q = s.query(CompositePk)
assert_raises(
- sa_exc.InvalidRequestError,
- q.get,
- {"i": 1, "j": '2', "k": 3}
+ sa_exc.InvalidRequestError, q.get, {"i": 1, "j": "2", "k": 3}
)
def test_get(self):
"pk_t",
metadata,
Column(
- "p_id",
- Integer,
- key="id",
- autoincrement=True,
- primary_key=True,
+ "p_id", Integer, key="id", autoincrement=True, primary_key=True
),
Column("data", String(30)),
)
table = Table(
"sometable",
metadata,
- Column(
- "id",
- Integer,
- autoincrement=False,
- primary_key=True,
- ),
+ Column("id", Integer, autoincrement=False, primary_key=True),
Column("data", String),
)