mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Applied Black
This commit is contained in:
parent
dcdef136db
commit
5534c320e4
2 changed files with 8 additions and 8 deletions
|
|
@ -741,9 +741,9 @@ class Table(Queryable):
|
|||
defaults=defaults,
|
||||
drop_foreign_keys=drop_foreign_keys,
|
||||
)
|
||||
pragma_foreign_keys_was_on = self.db.execute(
|
||||
"PRAGMA foreign_keys"
|
||||
).fetchone()[0]
|
||||
pragma_foreign_keys_was_on = self.db.execute("PRAGMA foreign_keys").fetchone()[
|
||||
0
|
||||
]
|
||||
try:
|
||||
if pragma_foreign_keys_was_on:
|
||||
self.db.execute("PRAGMA foreign_keys=0;")
|
||||
|
|
|
|||
|
|
@ -103,12 +103,12 @@ def test_transform_sql(fresh_db, params, expected_sql, use_pragma_foreign_keys):
|
|||
dogs.transform(**params)
|
||||
# If use_pragma_foreign_keys, check that we did the right thing
|
||||
if use_pragma_foreign_keys:
|
||||
assert ('PRAGMA foreign_keys=0;', None) in captured
|
||||
assert captured[-2] == ('PRAGMA foreign_key_check;', None)
|
||||
assert captured[-1] == ('PRAGMA foreign_keys=1;', None)
|
||||
assert ("PRAGMA foreign_keys=0;", None) in captured
|
||||
assert captured[-2] == ("PRAGMA foreign_key_check;", None)
|
||||
assert captured[-1] == ("PRAGMA foreign_keys=1;", None)
|
||||
else:
|
||||
assert ('PRAGMA foreign_keys=0;', None) not in captured
|
||||
assert ('PRAGMA foreign_keys=1;', None) not in captured
|
||||
assert ("PRAGMA foreign_keys=0;", None) not in captured
|
||||
assert ("PRAGMA foreign_keys=1;", None) not in captured
|
||||
|
||||
|
||||
def test_transform_sql_rowid_to_id(fresh_db):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue