mirror of https://github.com/borgbackup/borg.git
Fix test_size_on_disk_accurate on Windows
Pass the python file object / fd instead of the file path. On Windows, a tempfile cannot be opened again, unlike on Unix systems. See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
This commit is contained in:
parent
edf12186fc
commit
05997e2867
|
@ -260,7 +260,7 @@ class HashIndexSizeTestCase(BaseTestCase):
|
|||
idx[H(i)] = i, i**2
|
||||
with tempfile.NamedTemporaryFile() as file:
|
||||
idx.write(file)
|
||||
size = os.path.getsize(file.name)
|
||||
size = os.path.getsize(file.fileno())
|
||||
assert idx.size() == size
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue