Skip to content

Commit

Permalink
Update test_disk_usage to be more forgiving about dir sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Jan 8, 2025
1 parent 1523801 commit f99ea30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conda-store-server/tests/_internal/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def test_disk_usage(tmp_path):
test_dir.mkdir()

# This varies across OSes
dir_size = du(test_dir)
assert abs(dir_size - int(disk_usage(test_dir))) <= 1000
initial_du_size = du(test_dir)
initial_disk_usage_size = int(disk_usage(test_dir))

test_file = test_dir / "test_file"
test_file.write_text("a" * 1000)
Expand All @@ -33,5 +33,5 @@ def test_disk_usage(tmp_path):

val = disk_usage(test_dir)
assert isinstance(val, str)
assert 2000 + dir_size <= int(val) <= 2700 + dir_size
assert 2000 + dir_size <= du(test_dir) <= 2700 + dir_size
assert initial_disk_usage_size < int(val)
assert initial_du_size <= du(test_dir)

0 comments on commit f99ea30

Please sign in to comment.