2
0
Эх сурвалжийг харах

testsuite: archiver: check if symlinks supported before test_create_read_special_broken_symlink

On Windows, symlinks can only be created by administrator accounts.
Using are_symlinks_supported() skips the test if the symlink cannot be created.
See https://docs.python.org/3/library/os.html#os.symlink
Rayyan Ansari 2 жил өмнө
parent
commit
2505118fff

+ 1 - 0
src/borg/testsuite/archiver/create_cmd.py

@@ -756,6 +756,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
                 extracted_data = f.read()
         assert extracted_data == data
 
+    @pytest.mark.skipif(not are_symlinks_supported(), reason="symlinks not supported")
     def test_create_read_special_broken_symlink(self):
         os.symlink("somewhere does not exist", os.path.join(self.input_path, "link"))
         self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)