Browse Source

Fix flaking issues (#635).

Dan Helfman 4 months ago
parent
commit
63c39be55f

+ 1 - 1
borgmatic/actions/check.py

@@ -709,7 +709,7 @@ def run_check(
         **hook_context,
         **hook_context,
     )
     )
 
 
-    logger.info(f'Running consistency checks')
+    logger.info('Running consistency checks')
 
 
     repository_id = borgmatic.borg.check.get_repository_id(
     repository_id = borgmatic.borg.check.get_repository_id(
         repository['path'],
         repository['path'],

+ 1 - 1
borgmatic/commands/borgmatic.py

@@ -176,7 +176,7 @@ def run_configuration(config_filename, config, config_paths, arguments):
                         continue
                         continue
 
 
                     yield from log_error_records(
                     yield from log_error_records(
-                        f'Error running actions for repository',
+                        'Error running actions for repository',
                         error,
                         error,
                     )
                     )
                     encountered_error = error
                     encountered_error = error

+ 1 - 1
borgmatic/hooks/data_source/mariadb.py

@@ -49,7 +49,7 @@ def database_names_to_dump(database, extra_environment, dry_run):
         + ('--skip-column-names', '--batch')
         + ('--skip-column-names', '--batch')
         + ('--execute', 'show schemas')
         + ('--execute', 'show schemas')
     )
     )
-    logger.debug(f'Querying for "all" MariaDB databases to dump')
+    logger.debug('Querying for "all" MariaDB databases to dump')
     show_output = execute_command_and_capture_output(
     show_output = execute_command_and_capture_output(
         show_command, extra_environment=extra_environment
         show_command, extra_environment=extra_environment
     )
     )

+ 1 - 1
borgmatic/hooks/data_source/mysql.py

@@ -49,7 +49,7 @@ def database_names_to_dump(database, extra_environment, dry_run):
         + ('--skip-column-names', '--batch')
         + ('--skip-column-names', '--batch')
         + ('--execute', 'show schemas')
         + ('--execute', 'show schemas')
     )
     )
-    logger.debug(f'Querying for "all" MySQL databases to dump')
+    logger.debug('Querying for "all" MySQL databases to dump')
     show_output = execute_command_and_capture_output(
     show_output = execute_command_and_capture_output(
         show_command, extra_environment=extra_environment
         show_command, extra_environment=extra_environment
     )
     )

+ 1 - 1
borgmatic/hooks/data_source/postgresql.py

@@ -85,7 +85,7 @@ def database_names_to_dump(database, extra_environment, dry_run):
         + (('--username', database['username']) if 'username' in database else ())
         + (('--username', database['username']) if 'username' in database else ())
         + (tuple(database['list_options'].split(' ')) if 'list_options' in database else ())
         + (tuple(database['list_options'].split(' ')) if 'list_options' in database else ())
     )
     )
-    logger.debug(f'Querying for "all" PostgreSQL databases to dump')
+    logger.debug('Querying for "all" PostgreSQL databases to dump')
     list_output = execute_command_and_capture_output(
     list_output = execute_command_and_capture_output(
         list_command, extra_environment=extra_environment
         list_command, extra_environment=extra_environment
     )
     )

+ 3 - 3
tests/unit/test_logger.py

@@ -254,7 +254,7 @@ def test_get_log_prefix_with_no_handlers_does_not_raise():
         )
         )
     )
     )
 
 
-    assert module.get_log_prefix() == None
+    assert module.get_log_prefix() is None
 
 
 
 
 def test_get_log_prefix_with_no_formatters_does_not_raise():
 def test_get_log_prefix_with_no_formatters_does_not_raise():
@@ -268,7 +268,7 @@ def test_get_log_prefix_with_no_formatters_does_not_raise():
         )
         )
     )
     )
 
 
-    assert module.get_log_prefix() == None
+    assert module.get_log_prefix() is None
 
 
 
 
 def test_get_log_prefix_with_no_prefix_does_not_raise():
 def test_get_log_prefix_with_no_prefix_does_not_raise():
@@ -284,7 +284,7 @@ def test_get_log_prefix_with_no_prefix_does_not_raise():
         )
         )
     )
     )
 
 
-    assert module.get_log_prefix() == None
+    assert module.get_log_prefix() is None
 
 
 
 
 def test_set_log_prefix_updates_all_handlers():
 def test_set_log_prefix_updates_all_handlers():