Parcourir la source

Fix flake issues (#80).

Dan Helfman il y a 6 mois
Parent
commit
ae8a9db27d

+ 0 - 1
borgmatic/hooks/data_source/snapshot.py

@@ -1,4 +1,3 @@
-import itertools
 import pathlib
 import pathlib
 
 
 IS_A_HOOK = False
 IS_A_HOOK = False

+ 0 - 1
tests/end-to-end/commands/fake_findmnt.py

@@ -1,5 +1,4 @@
 import argparse
 import argparse
-import json
 import sys
 import sys
 
 
 
 

+ 1 - 1
tests/end-to-end/test_btrfs.py

@@ -55,7 +55,7 @@ def test_btrfs_create_and_list():
 
 
         # Assert that the snapshot has been deleted.
         # Assert that the snapshot has been deleted.
         assert not subprocess.check_output(
         assert not subprocess.check_output(
-            f'python3 /app/tests/end-to-end/commands/fake_btrfs.py subvolume list -s /mnt/subvolume'.split(
+            'python3 /app/tests/end-to-end/commands/fake_btrfs.py subvolume list -s /mnt/subvolume'.split(
                 ' '
                 ' '
             )
             )
         )
         )

+ 1 - 1
tests/end-to-end/test_zfs.py

@@ -56,7 +56,7 @@ def test_zfs_create_and_list():
 
 
         # Assert that the snapshot has been deleted.
         # Assert that the snapshot has been deleted.
         assert not subprocess.check_output(
         assert not subprocess.check_output(
-            f'python3 /app/tests/end-to-end/commands/fake_zfs.py list -H -t snapshot'.split(' ')
+            'python3 /app/tests/end-to-end/commands/fake_zfs.py list -H -t snapshot'.split(' ')
         )
         )
     finally:
     finally:
         shutil.rmtree(temporary_directory)
         shutil.rmtree(temporary_directory)

+ 0 - 2
tests/unit/hooks/data_source/test_lvm.py

@@ -67,7 +67,6 @@ def test_get_logical_volumes_with_invalid_lsblk_json_errors():
         'execute_command_and_capture_output'
         'execute_command_and_capture_output'
     ).and_return('{')
     ).and_return('{')
 
 
-    contained = {'/mnt/lvolume', '/mnt/lvolume/subdir'}
     flexmock(module.borgmatic.hooks.data_source.snapshot).should_receive(
     flexmock(module.borgmatic.hooks.data_source.snapshot).should_receive(
         'get_contained_directories'
         'get_contained_directories'
     ).never()
     ).never()
@@ -83,7 +82,6 @@ def test_get_logical_volumes_with_lsblk_json_missing_keys_errors():
         'execute_command_and_capture_output'
         'execute_command_and_capture_output'
     ).and_return('{"block_devices": [{}]}')
     ).and_return('{"block_devices": [{}]}')
 
 
-    contained = {'/mnt/lvolume', '/mnt/lvolume/subdir'}
     flexmock(module.borgmatic.hooks.data_source.snapshot).should_receive(
     flexmock(module.borgmatic.hooks.data_source.snapshot).should_receive(
         'get_contained_directories'
         'get_contained_directories'
     ).never()
     ).never()