@@ -417,7 +417,7 @@ def test_transfer_transfers_all_tables_from_mysql_to_sqlite(
417417 assert not any (record .levelname == "ERROR" for record in caplog .records )
418418
419419 sqlite_engine : Engine = create_engine (
420- "sqlite:///{database}" . format ( database = sqlite_database ) ,
420+ f "sqlite:///{ sqlite_database } " ,
421421 json_serializer = json .dumps ,
422422 json_deserializer = json .loads ,
423423 )
@@ -426,13 +426,7 @@ def test_transfer_transfers_all_tables_from_mysql_to_sqlite(
426426 sqlite_inspect : Inspector = inspect (sqlite_engine )
427427 sqlite_tables : t .List [str ] = sqlite_inspect .get_table_names ()
428428 mysql_engine : Engine = create_engine (
429- "mysql+mysqldb://{user}:{password}@{host}:{port}/{database}" .format (
430- user = mysql_credentials .user ,
431- password = mysql_credentials .password ,
432- host = mysql_credentials .host ,
433- port = mysql_credentials .port ,
434- database = mysql_credentials .database ,
435- )
429+ f"mysql+mysqldb://{ mysql_credentials .user } :{ mysql_credentials .password } @{ mysql_credentials .host } :{ mysql_credentials .port } /{ mysql_credentials .database } "
436430 )
437431 mysql_cnx : Connection = mysql_engine .connect ()
438432 mysql_inspect : Inspector = inspect (mysql_engine )
@@ -466,10 +460,7 @@ def test_transfer_transfers_all_tables_from_mysql_to_sqlite(
466460 mysql_index : t .Dict [str , t .Any ] = {}
467461 for key in index_keys :
468462 if key == "name" and prefix_indices :
469- mysql_index [key ] = "{table}_{name}" .format (
470- table = table_name ,
471- name = index [key ], # type: ignore[literal-required]
472- )
463+ mysql_index [key ] = f"{ table_name } _{ index [key ]} " # type: ignore[literal-required]
473464 else :
474465 mysql_index [key ] = index [key ] # type: ignore[literal-required]
475466 mysql_indices .append (t .cast (ReflectedIndex , mysql_index ))
@@ -510,7 +501,7 @@ def test_transfer_transfers_all_tables_from_mysql_to_sqlite(
510501 mysql_fk_result : CursorResult = mysql_cnx .execute (mysql_fk_stmt )
511502 mysql_foreign_keys : t .List [t .Dict [str , t .Any ]] = [dict (row ) for row in mysql_fk_result .mappings ()]
512503
513- sqlite_fk_stmt : TextClause = text ('PRAGMA foreign_key_list("{table }")' . format ( table = table_name ) )
504+ sqlite_fk_stmt : TextClause = text (f 'PRAGMA foreign_key_list("{ table_name } ")' )
514505 sqlite_fk_result : CursorResult = sqlite_cnx .execute (sqlite_fk_stmt )
515506 if sqlite_fk_result .returns_rows :
516507 for row in sqlite_fk_result .mappings ():
@@ -884,13 +875,7 @@ def test_transfer_specific_tables_transfers_only_specified_tables_from_mysql_to_
884875 exclude_tables : bool ,
885876 ) -> None :
886877 mysql_engine : Engine = create_engine (
887- "mysql+mysqldb://{user}:{password}@{host}:{port}/{database}" .format (
888- user = mysql_credentials .user ,
889- password = mysql_credentials .password ,
890- host = mysql_credentials .host ,
891- port = mysql_credentials .port ,
892- database = mysql_credentials .database ,
893- )
878+ f"mysql+mysqldb://{ mysql_credentials .user } :{ mysql_credentials .password } @{ mysql_credentials .host } :{ mysql_credentials .port } /{ mysql_credentials .database } "
894879 )
895880 mysql_cnx : Connection = mysql_engine .connect ()
896881 mysql_inspect : Inspector = inspect (mysql_engine )
@@ -921,7 +906,7 @@ def test_transfer_specific_tables_transfers_only_specified_tables_from_mysql_to_
921906 message in [record .message for record in caplog .records ]
922907 for message in set (
923908 [
924- "Transferring table {}" . format ( table )
909+ f "Transferring table { table } "
925910 for table in (remaining_tables if exclude_tables else random_mysql_tables )
926911 ]
927912 + ["Done!" ]
@@ -931,7 +916,7 @@ def test_transfer_specific_tables_transfers_only_specified_tables_from_mysql_to_
931916 assert not any (record .levelname == "ERROR" for record in caplog .records )
932917
933918 sqlite_engine : Engine = create_engine (
934- "sqlite:///{database}" . format ( database = sqlite_database ) ,
919+ f "sqlite:///{ sqlite_database } " ,
935920 json_serializer = json .dumps ,
936921 json_deserializer = json .loads ,
937922 )
@@ -960,10 +945,7 @@ def test_transfer_specific_tables_transfers_only_specified_tables_from_mysql_to_
960945 mysql_index : t .Dict [str , t .Any ] = {}
961946 for key in index_keys :
962947 if key == "name" and prefix_indices :
963- mysql_index [key ] = "{table}_{name}" .format (
964- table = table_name ,
965- name = index [key ], # type: ignore[literal-required]
966- )
948+ mysql_index [key ] = f"{ table_name } _{ index [key ]} " # type: ignore[literal-required]
967949 else :
968950 mysql_index [key ] = index [key ] # type: ignore[literal-required]
969951 mysql_indices .append (t .cast (ReflectedIndex , mysql_index ))
@@ -1185,7 +1167,7 @@ def test_transfer_limited_rows_from_mysql_to_sqlite(
11851167 assert not any (record .levelname == "ERROR" for record in caplog .records )
11861168
11871169 sqlite_engine : Engine = create_engine (
1188- "sqlite:///{database}" . format ( database = sqlite_database ) ,
1170+ f "sqlite:///{ sqlite_database } " ,
11891171 json_serializer = json .dumps ,
11901172 json_deserializer = json .loads ,
11911173 )
@@ -1194,13 +1176,7 @@ def test_transfer_limited_rows_from_mysql_to_sqlite(
11941176 sqlite_inspect : Inspector = inspect (sqlite_engine )
11951177 sqlite_tables : t .List [str ] = sqlite_inspect .get_table_names ()
11961178 mysql_engine : Engine = create_engine (
1197- "mysql+mysqldb://{user}:{password}@{host}:{port}/{database}" .format (
1198- user = mysql_credentials .user ,
1199- password = mysql_credentials .password ,
1200- host = mysql_credentials .host ,
1201- port = mysql_credentials .port ,
1202- database = mysql_credentials .database ,
1203- )
1179+ f"mysql+mysqldb://{ mysql_credentials .user } :{ mysql_credentials .password } @{ mysql_credentials .host } :{ mysql_credentials .port } /{ mysql_credentials .database } "
12041180 )
12051181 mysql_cnx : Connection = mysql_engine .connect ()
12061182 mysql_inspect : Inspector = inspect (mysql_engine )
@@ -1234,10 +1210,7 @@ def test_transfer_limited_rows_from_mysql_to_sqlite(
12341210 mysql_index : t .Dict [str , t .Any ] = {}
12351211 for key in index_keys :
12361212 if key == "name" and prefix_indices :
1237- mysql_index [key ] = "{table}_{name}" .format (
1238- table = table_name ,
1239- name = index [key ], # type: ignore[literal-required]
1240- )
1213+ mysql_index [key ] = f"{ table_name } _{ index [key ]} " # type: ignore[literal-required]
12411214 else :
12421215 mysql_index [key ] = index [key ] # type: ignore[literal-required]
12431216 mysql_indices .append (t .cast (ReflectedIndex , mysql_index ))
@@ -1278,7 +1251,7 @@ def test_transfer_limited_rows_from_mysql_to_sqlite(
12781251 mysql_fk_result : CursorResult = mysql_cnx .execute (mysql_fk_stmt )
12791252 mysql_foreign_keys : t .List [t .Dict [str , t .Any ]] = [dict (row ) for row in mysql_fk_result .mappings ()]
12801253
1281- sqlite_fk_stmt : TextClause = text ('PRAGMA foreign_key_list("{table }")' . format ( table = table_name ) )
1254+ sqlite_fk_stmt : TextClause = text (f 'PRAGMA foreign_key_list("{ table_name } ")' )
12821255 sqlite_fk_result : CursorResult = sqlite_cnx .execute (sqlite_fk_stmt )
12831256 if sqlite_fk_result .returns_rows :
12841257 for row in sqlite_fk_result .mappings ():
0 commit comments