Skip to content

Commit fd4b26d

Browse files
style: Apply ruff formatting to test files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d350d6c commit fd4b26d

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

tests/integration/test_json.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,23 @@ def test_restrict(schema_json):
158158

159159
assert (Team & "`car`->>'$.length' > 30").fetch1("name") == "business", "<= 30"
160160

161-
assert (Team & "JSON_VALUE(`car`, '$.safety_inspected' RETURNING UNSIGNED) = 0").fetch1("name") == "business", (
162-
"Has `safety_inspected` set to `true`"
163-
)
161+
assert (Team & "JSON_VALUE(`car`, '$.safety_inspected' RETURNING UNSIGNED) = 0").fetch1(
162+
"name"
163+
) == "business", "Has `safety_inspected` set to `true`"
164164

165-
assert (Team & "`car`->>'$.headlights[0].hyper_white' = 'null'").fetch1("name") == "engineering", (
166-
"Has 1st `headlight` with `hyper_white` not set to `null`"
167-
)
165+
assert (Team & "`car`->>'$.headlights[0].hyper_white' = 'null'").fetch1(
166+
"name"
167+
) == "engineering", "Has 1st `headlight` with `hyper_white` not set to `null`"
168168

169169
assert (Team & "`car`->>'$.inspected' IS NOT NULL").fetch1("name") == "engineering", "Missing `inspected` key"
170170

171-
assert (Team & "`car`->>'$.tire_pressure' = '[34, 30, 27, 32]'").fetch1("name") == "business", (
172-
"`tire_pressure` array did not match"
173-
)
171+
assert (Team & "`car`->>'$.tire_pressure' = '[34, 30, 27, 32]'").fetch1(
172+
"name"
173+
) == "business", "`tire_pressure` array did not match"
174174

175-
assert (Team & """`car`->>'$.headlights[1]' = '{"side": "right", "hyper_white": true}'""").fetch1("name") == "business", (
176-
"2nd `headlight` object did not match"
177-
)
175+
assert (Team & """`car`->>'$.headlights[1]' = '{"side": "right", "hyper_white": true}'""").fetch1(
176+
"name"
177+
) == "business", "2nd `headlight` object did not match"
178178

179179

180180
def test_proj(schema_json):

tests/integration/test_nan.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def test_insert_nan(schema_nan_pop, arr_a):
4040
# Convert None to np.nan for comparison
4141
b_float = np.array([np.nan if v is None else v for v in b], dtype=float)
4242
assert (np.isnan(arr_a) == np.isnan(b_float)).all(), "incorrect handling of Nans"
43-
assert np.allclose(arr_a[np.logical_not(np.isnan(arr_a))], b_float[np.logical_not(np.isnan(b_float))]), (
44-
"incorrect storage of floats"
45-
)
43+
assert np.allclose(
44+
arr_a[np.logical_not(np.isnan(arr_a))], b_float[np.logical_not(np.isnan(b_float))]
45+
), "incorrect storage of floats"
4646

4747

4848
def test_nulls_do_not_affect_primary_keys(schema_nan_pop, arr_a):

tests/integration/test_privileges.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def test_insert_failure(self, connection_djview, schema_any):
8383
unprivileged = dj.Schema(schema_any.database, namespace, connection=connection_djview)
8484
unprivileged.spawn_missing_classes()
8585
UnprivilegedLanguage = namespace["Language"]
86-
assert issubclass(UnprivilegedLanguage, dj.Lookup) and len(UnprivilegedLanguage()) == len(schema.Language()), (
87-
"failed to spawn missing classes"
88-
)
86+
assert issubclass(UnprivilegedLanguage, dj.Lookup) and len(UnprivilegedLanguage()) == len(
87+
schema.Language()
88+
), "failed to spawn missing classes"
8989
with pytest.raises(dj.DataJointError):
9090
UnprivilegedLanguage().insert1(("Socrates", "Greek"))
9191

tests/integration/test_relation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ def relation_selector(attr):
277277
for name, rel in getmembers(schema, relation_selector):
278278
assert re.match(rel.tier_regexp, rel.table_name), "Regular expression does not match for {name}".format(name=name)
279279
for tier in tiers:
280-
assert issubclass(rel, tier) or not re.match(tier.tier_regexp, rel.table_name), (
281-
"Regular expression matches for {name} but should not".format(name=name)
282-
)
280+
assert issubclass(rel, tier) or not re.match(
281+
tier.tier_regexp, rel.table_name
282+
), "Regular expression matches for {name} but should not".format(name=name)
283283

284284

285285
def test_table_size(experiment):

tests/integration/test_relational_operand.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def test_rename(schema_simp_pop):
7878
x = B().proj(i="id_a") & "i in (1,2,3,4)"
7979
lenx = len(x)
8080
assert len(x) == len(B() & "id_a in (1,2,3,4)"), "incorrect restriction of renamed attributes"
81-
assert len(x & "id_b in (1,2)") == len(B() & "id_b in (1,2) and id_a in (1,2,3,4)"), (
82-
"incorrect restriction of renamed restriction"
83-
)
81+
assert len(x & "id_b in (1,2)") == len(
82+
B() & "id_b in (1,2) and id_a in (1,2,3,4)"
83+
), "incorrect restriction of renamed restriction"
8484
assert len(x) == lenx, "restriction modified original"
8585
y = x.proj(j="i")
8686
assert len(y) == len(B() & "id_a in (1,2,3,4)"), "incorrect projection of restriction"
@@ -184,9 +184,9 @@ def test_rename_non_dj_attribute(connection_test, schema_simp_pop, schema_any_po
184184
schema = prefix + "_test1"
185185
connection_test.query(f"CREATE TABLE {schema}.test_table (oldID int PRIMARY KEY)").fetchall()
186186
mySchema = dj.VirtualModule(schema, schema, connection=connection_test)
187-
assert "oldID" not in mySchema.TestTable.proj(new_name="oldID").heading.attributes.keys(), (
188-
"Failed to rename attribute correctly"
189-
)
187+
assert (
188+
"oldID" not in mySchema.TestTable.proj(new_name="oldID").heading.attributes.keys()
189+
), "Failed to rename attribute correctly"
190190
connection_test.query(f"DROP TABLE {schema}.test_table")
191191

192192

0 commit comments

Comments
 (0)