From 9e056c5676c8de2840fd5b3f640c6dcc8e8867d8 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 23 Jan 2024 18:31:27 +0000 Subject: [PATCH] tests/test_general.py:test_3081(): avoid problems on Windows. On Windows renaming to an existing file never works, so have removed those parts of the test. We still check explicitly that the file handles are closed, so the test is still doing what we want. --- tests/test_general.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/test_general.py b/tests/test_general.py index e2fe68c9e..a27d83d26 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -863,17 +863,3 @@ def next_fd(): assert fd2 == fd1 + 1 assert fd3 == fd1 assert fd4 == fd1 - - # Check copying/renaming to file we have opened; this is mainly for Windows - # where renames fail if destination is open. - # - document = fitz.open(path2) - document.close() - shutil.copy2(path1, path2) - print(f'{document=}') - - document = fitz.open(path2) - document.close() - shutil.copy2(path1, path3) - os.rename(path3, path2) - print(f'{document=}')