Skip to content

Commit e896998

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent a1248e6 commit e896998

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

tests/test_context_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def test_commit_called_once_in_transaction(self, mocker, tmp_path) -> None:
115115

116116
# Assert that the data was committed
117117
assert result is not None, "Data was not committed."
118-
assert (
119-
result[3] == "test"
120-
), f"Expected slug to be 'test', but got {result[3]}"
118+
assert result[3] == "test", (
119+
f"Expected slug to be 'test', but got {result[3]}"
120+
)
121121

122122
# Close the new connection
123123
new_conn.close()

tests/test_debug_logging.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ def test_sqliterdb_debug_default(self) -> None:
1717
def test_sqliterdb_debug_set_false(self) -> None:
1818
"""Test that the default value for the debug flag is False."""
1919
db = SqliterDB(":memory:", debug=False) # Set debug argument to False
20-
assert (
21-
db.debug is False
22-
), "The debug flag should be False when explicitly passed as False."
20+
assert db.debug is False, (
21+
"The debug flag should be False when explicitly passed as False."
22+
)
2323

2424
def test_sqliterdb_debug_set_true(self) -> None:
2525
"""Test that the debug flag can be set to True."""
2626
db = SqliterDB(":memory:", debug=True) # Set debug argument to True
27-
assert (
28-
db.debug is True
29-
), "The debug flag should be True when explicitly passed as True."
27+
assert db.debug is True, (
28+
"The debug flag should be True when explicitly passed as True."
29+
)
3030

3131
def test_debug_sql_output_basic_query(
3232
self, db_mock_complex_debug: SqliterDB, caplog

tests/test_properties.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def test_is_autocommit_property_true(self) -> None:
4040
def test_is_autocommit_property_false(self) -> None:
4141
"""Test 'is_autocommit' prop returns False when auto-commit disabled."""
4242
db = SqliterDB(memory=True, auto_commit=False)
43-
assert (
44-
db.is_autocommit is False
45-
), "Expected False for auto-commit disabled"
43+
assert db.is_autocommit is False, (
44+
"Expected False for auto-commit disabled"
45+
)
4646

4747
def test_is_connected_property_when_connected(self) -> None:
4848
"""Test the 'is_connected' property when the database is connected."""
@@ -71,9 +71,9 @@ class Meta:
7171

7272
# Verify that the table exists while the connection is still open
7373
table_names = db.table_names
74-
assert (
75-
"test_table" in table_names
76-
), f"Expected 'test_table', got {table_names}"
74+
assert "test_table" in table_names, (
75+
f"Expected 'test_table', got {table_names}"
76+
)
7777

7878
# Explicitly close the connection afterwards
7979
db.close()
@@ -94,9 +94,9 @@ class Meta:
9494

9595
# Check the table names while the connection is still open
9696
table_names = db.table_names
97-
assert (
98-
"another_table" in table_names
99-
), f"Expected 'another_table', got {table_names}"
97+
assert "another_table" in table_names, (
98+
f"Expected 'another_table', got {table_names}"
99+
)
100100

101101
# Close the connection explicitly after the check
102102
db.close()
@@ -127,9 +127,9 @@ class Meta:
127127
# Ensure that accessing table_names does NOT raise an error Since
128128
# it's file-based, the table should still exist after reconnecting
129129
table_names = db.table_names
130-
assert (
131-
"test_table" in table_names
132-
), f"Expected 'test_table', got {table_names}"
130+
assert "test_table" in table_names, (
131+
f"Expected 'test_table', got {table_names}"
132+
)
133133

134134
def test_table_names_connection_failure(self, mocker) -> None:
135135
"""Test 'table_names' raises exception if the connection fails."""

tests/test_sqliter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,9 @@ def test_complex_model_primary_key(self, db_mock) -> None:
586586

587587
# Assert that the primary key is the 'id' field and is an INTEGER
588588
assert primary_key_column is not None, "Primary key not found"
589-
assert (
590-
primary_key_column[1] == "pk"
591-
), f"Expected 'id' as primary key, but got {primary_key_column[1]}"
589+
assert primary_key_column[1] == "pk", (
590+
f"Expected 'id' as primary key, but got {primary_key_column[1]}"
591+
)
592592
assert primary_key_column[2] == "INTEGER", (
593593
f"Expected 'INTEGER' type for primary key, but got "
594594
f"{primary_key_column[2]}"

0 commit comments

Comments
 (0)