Pārlūkot izejas kodu

Merge pull request #8980 from ThomasWaldmann/save_space-test_create_big-master

save space in test_create_* tests
TW 3 nedēļas atpakaļ
vecāks
revīzija
498d836aea
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. 13 0
      src/borg/testsuite/archiver/create_cmd_test.py

+ 13 - 0
src/borg/testsuite/archiver/create_cmd_test.py

@@ -959,6 +959,10 @@ def test_create_big_zeros_files(archivers, request):
             # Also verify the directory structure matches
             # Also verify the directory structure matches
             assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
             assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
 
 
+    # Remove input files
+    for i in range(count):
+        os.unlink(os.path.join(archiver.input_path, f"zeros_{i}"))
+
 
 
 def test_create_big_random_files(archivers, request):
 def test_create_big_random_files(archivers, request):
     """Test creating an archive from 10 files with 10MB random data each."""
     """Test creating an archive from 10 files with 10MB random data each."""
@@ -991,6 +995,10 @@ def test_create_big_random_files(archivers, request):
             # Also verify the directory structure matches
             # Also verify the directory structure matches
             assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
             assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
 
 
+    # Remove input files
+    for i in range(count):
+        os.unlink(os.path.join(archiver.input_path, f"random_{i}"))
+
 
 
 def test_create_with_compression_algorithms(archivers, request):
 def test_create_with_compression_algorithms(archivers, request):
     """Test creating archives with different compression algorithms."""
     """Test creating archives with different compression algorithms."""
@@ -1052,3 +1060,8 @@ def test_create_with_compression_algorithms(archivers, request):
 
 
                 # Also verify the directory structure matches
                 # Also verify the directory structure matches
                 assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
                 assert_dirs_equal(archiver.input_path, os.path.join(extract_path, "input"))
+
+    # Remove input files
+    for i in range(count):
+        os.unlink(os.path.join(archiver.input_path, f"zeros_{i}"))
+        os.unlink(os.path.join(archiver.input_path, f"random_{i}"))