@@ -127,7 +127,7 @@ def test_partition_cmd_several_tables(self):
127127 output = partition_cmd (args )
128128
129129 self .assertEqual (len (output ), 2 )
130- self .assertSetEqual (set (output ), set ([ "testtable" , "another_table" ]) )
130+ self .assertSetEqual (set (output ), { "testtable" , "another_table" } )
131131
132132 def test_partition_unpartitioned_table (self ):
133133 o = run_partition_cmd_yaml (
@@ -186,7 +186,7 @@ def test_partition_cmd_two_tables(self):
186186 mariadb: { str (fake_exec )}
187187"""
188188 )
189- self .assertSetEqual (set (o ), set ([ "test" , "test_with_retention" ]) )
189+ self .assertSetEqual (set (o ), { "test" , "test_with_retention" } )
190190
191191 def test_partition_period_daily (self ):
192192 o = run_partition_cmd_yaml (
@@ -201,7 +201,7 @@ def test_partition_period_daily(self):
201201"""
202202 )
203203 self .assertSequenceEqual (
204- set (o ), set ([ "partitioned_last_week" , "partitioned_yesterday" ])
204+ set (o ), { "partitioned_last_week" , "partitioned_yesterday" }
205205 )
206206
207207 def test_partition_period_seven_days (self ):
@@ -221,16 +221,14 @@ def test_partition_period_seven_days(self):
221221
222222 self .assertEqual (
223223 set (logctx .output ),
224- set (
225- [
226- "INFO:partition:Evaluating Table partitioned_last_week "
227- "(duration=7 days, 0:00:00)" ,
228- "DEBUG:partition:Table partitioned_last_week has no pending SQL updates." , # noqa: E501
229- "INFO:partition:Evaluating Table partitioned_yesterday "
230- "(duration=7 days, 0:00:00)" ,
231- "DEBUG:partition:Table partitioned_yesterday has no pending SQL updates." , # noqa: E501
232- ]
233- ),
224+ {
225+ "INFO:partition:Evaluating Table partitioned_last_week "
226+ "(duration=7 days, 0:00:00)" ,
227+ "DEBUG:partition:Table partitioned_last_week has no pending SQL updates." , # noqa: E501
228+ "INFO:partition:Evaluating Table partitioned_yesterday "
229+ "(duration=7 days, 0:00:00)" ,
230+ "DEBUG:partition:Table partitioned_yesterday has no pending SQL updates." , # noqa: E501
231+ },
234232 )
235233 self .assertSequenceEqual (list (o ), [])
236234
@@ -249,7 +247,7 @@ def test_partition_period_different_per_table(self):
249247"""
250248 )
251249 self .assertSequenceEqual (
252- set (o ), set ([ "partitioned_yesterday" , "partitioned_last_week" ])
250+ set (o ), { "partitioned_yesterday" , "partitioned_last_week" }
253251 )
254252
255253 def test_partition_with_db_url (self ):
@@ -283,7 +281,7 @@ def assert_stats_results(self, results):
283281
284282 def assert_stats_prometheus_outfile (self , prom_file ):
285283 lines = prom_file .split ("\n " )
286- metrics = dict ()
284+ metrics = {}
287285 for line in lines :
288286 if not line .startswith ("#" ) and len (line ) > 0 :
289287 key , value = line .split (" " )
@@ -350,9 +348,7 @@ def test_cli_tables_override_yaml(self):
350348""" ,
351349 datetime .now (tz = timezone .utc ),
352350 )
353- self .assertEqual (
354- {str (x .name ) for x in conf .tables }, set (["table_one" , "table_two" ])
355- )
351+ self .assertEqual ({str (x .name ) for x in conf .tables }, {"table_one" , "table_two" })
356352
357353 def test_cli_mariadb_override_yaml (self ):
358354 args = PARSER .parse_args (["--mariadb" , "/usr/bin/true" , "stats" ])
@@ -651,12 +647,10 @@ def test_drop_invalid_config(self):
651647 )
652648 self .assertEqual (
653649 set (logctx .output ),
654- set (
655- [
656- "WARNING:do_find_drops_for_tables:unused:"
657- "Cannot process Table unused: no retention specified"
658- ]
659- ),
650+ {
651+ "WARNING:do_find_drops_for_tables:unused:"
652+ "Cannot process Table unused: no retention specified"
653+ },
660654 )
661655
662656 def test_drop_no_sql (self ):
@@ -675,10 +669,8 @@ def test_drop_no_sql(self):
675669 )
676670 self .assertEqual (
677671 set (logctx .output ),
678- set (
679- [
680- "WARNING:do_find_drops_for_tables:unused:"
681- "Cannot process Table unused: no date query specified"
682- ]
683- ),
672+ {
673+ "WARNING:do_find_drops_for_tables:unused:"
674+ "Cannot process Table unused: no date query specified"
675+ },
684676 )
0 commit comments