Merge pull request #7251 from puetzk/test_size_on_disk_accurate-flush

Fix test_size_on_disk_accurate for large st_blksize, fixes #7250
This commit is contained in:
TW 2023-01-13 10:49:41 +01:00 committed by GitHub
commit fb9717567e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,9 +258,9 @@ class HashIndexSizeTestCase(BaseTestCase):
idx = ChunkIndex()
for i in range(1234):
idx[H(i)] = i, i**2
with tempfile.NamedTemporaryFile() as file:
idx.write(file)
size = os.path.getsize(file.fileno())
with unopened_tempfile() as filepath:
idx.write(filepath)
size = os.path.getsize(filepath)
assert idx.size() == size