@@ -76,7 +76,7 @@ async def are_all_db_processes_down(ops_test: OpsTest, process: str, signal: str
76
76
77
77
# If something was returned, there is a running process.
78
78
if len (processes ) > 0 :
79
- logger .info ("Unit {unit.name} not yet down" )
79
+ logger .info (f "Unit { unit .name } not yet down" )
80
80
# Try to rekill the unit
81
81
await send_signal_to_process (ops_test , unit .name , process , signal )
82
82
raise ProcessRunningError
@@ -108,9 +108,9 @@ async def are_writes_increasing(
108
108
use_ip_from_inside = use_ip_from_inside ,
109
109
extra_model = extra_model ,
110
110
)
111
- assert (
112
- more_writes [member ] > count
113
- ), f" { member } : writes not continuing to DB (current writes: { more_writes [ member ] } - previous writes: { count } )"
111
+ assert more_writes [ member ] > count , (
112
+ f" { member } : writes not continuing to DB (current writes: { more_writes [member ]} - previous writes: { count } )"
113
+ )
114
114
115
115
116
116
async def app_name (
@@ -214,9 +214,9 @@ async def is_cluster_updated(
214
214
) -> None :
215
215
# Verify that the old primary is now a replica.
216
216
logger .info ("checking that the former primary is now a replica" )
217
- assert await is_replica (
218
- ops_test , primary_name , use_ip_from_inside
219
- ), "there are more than one primary in the cluster."
217
+ assert await is_replica (ops_test , primary_name , use_ip_from_inside ), (
218
+ "there are more than one primary in the cluster."
219
+ )
220
220
221
221
# Verify that all units are part of the same cluster.
222
222
logger .info ("checking that all units are part of the same cluster" )
@@ -255,9 +255,9 @@ async def check_writes(
255
255
print (
256
256
f"member: { member } , count: { count } , max_number_written: { max_number_written [member ]} , total_expected_writes: { total_expected_writes } "
257
257
)
258
- assert (
259
- count == max_number_written [ member ]
260
- ), f" { member } : writes to the db were missed: count of actual writes different from the max number written."
258
+ assert count == max_number_written [ member ], (
259
+ f" { member } : writes to the db were missed: count of actual writes different from the max number written."
260
+ )
261
261
assert total_expected_writes == count , f"{ member } : writes to the db were missed."
262
262
return total_expected_writes
263
263
@@ -309,7 +309,7 @@ def count_writes_on_members(members, password, down_ips) -> tuple[dict[str, int]
309
309
f" host='{ host } ' password='{ password } ' connect_timeout=10"
310
310
)
311
311
312
- member_name = f' { member [" model" ]} .{ member [" name" ] } '
312
+ member_name = f" { member [' model' ]} .{ member [' name' ] } "
313
313
connection = None
314
314
try :
315
315
with (
@@ -378,9 +378,9 @@ async def fetch_cluster_members(ops_test: OpsTest, use_ip_from_inside: bool = Fa
378
378
if len (member_ips ) > 0 :
379
379
# If the list of members IPs was already fetched, also compare the
380
380
# list provided by other members.
381
- assert member_ips == {
382
- member [ "host" ] for member in cluster_info . json ()[ "members" ]
383
- }, "members report different lists of cluster members."
381
+ assert member_ips == {member [ "host" ] for member in cluster_info . json ()[ "members" ]}, (
382
+ "members report different lists of cluster members."
383
+ )
384
384
else :
385
385
member_ips = {member ["host" ] for member in cluster_info .json ()["members" ]}
386
386
return member_ips
@@ -929,9 +929,9 @@ async def add_unit_with_storage(ops_test, app, storage):
929
929
assert return_code == 0 , "Failed to add unit with storage"
930
930
async with ops_test .fast_forward ():
931
931
await ops_test .model .wait_for_idle (apps = [app ], status = "active" , timeout = 2000 )
932
- assert (
933
- len ( ops_test . model . applications [ app ]. units ) == expected_units
934
- ), "New unit not added to model"
932
+ assert len ( ops_test . model . applications [ app ]. units ) == expected_units , (
933
+ "New unit not added to model"
934
+ )
935
935
936
936
# verify storage attached
937
937
curr_units = [unit .name for unit in ops_test .model .applications [app ].units ]
0 commit comments