Skip to content

Commit

Permalink
tests/test_general.py:test_3081(): avoid problems on Windows.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
julian-smith-artifex-com committed Jan 23, 2024
1 parent 5d6a7db commit 9e056c5
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=}')

0 comments on commit 9e056c5

Please sign in to comment.