Skip to content

Commit 40b098d

Browse files
committed
Remove cleanup now handled by the rig
1 parent b5e7c15 commit 40b098d

1 file changed

Lines changed: 19 additions & 25 deletions

File tree

tests/test_s3_specific.py

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,31 @@ def _download_with_threads(s3_rig, tmp_path, use_threads):
5656
"""Job used by tests to ensure Transfer config changes are
5757
actually passed through to boto3 and respected.
5858
"""
59-
try:
60-
sleep(1) # give test monitoring process time to start watching
61-
62-
transfer_config = TransferConfig(
63-
max_concurrency=100,
64-
use_threads=use_threads,
65-
multipart_chunksize=1 * 1024,
66-
multipart_threshold=10 * 1024,
67-
)
68-
client = s3_rig.client_class(boto3_transfer_config=transfer_config)
69-
p = client.CloudPath(f"s3://{s3_rig.drive}/{s3_rig.test_dir}/dir_0/file0_to_download.txt")
59+
sleep(1) # give test monitoring process time to start watching
60+
61+
transfer_config = TransferConfig(
62+
max_concurrency=100,
63+
use_threads=use_threads,
64+
multipart_chunksize=1 * 1024,
65+
multipart_threshold=10 * 1024,
66+
)
67+
client = s3_rig.client_class(boto3_transfer_config=transfer_config)
68+
p = client.CloudPath(f"s3://{s3_rig.drive}/{s3_rig.test_dir}/dir_0/file0_to_download.txt")
7069

71-
assert not p.exists()
70+
assert not p.exists()
7271

73-
# file should be about 60KB
74-
text = "lalala" * 10_000
75-
p.write_text(text)
72+
# file should be about 60KB
73+
text = "lalala" * 10_000
74+
p.write_text(text)
7675

77-
assert p.exists()
78-
79-
# assert not (dl_dir / p.name).exists()
80-
p.download_to(tmp_path)
76+
assert p.exists()
8177

82-
p.unlink()
78+
# assert not (dl_dir / p.name).exists()
79+
p.download_to(tmp_path)
8380

84-
assert not p.exists()
81+
p.unlink()
8582

86-
finally:
87-
p = s3_rig.create_cloud_path("dir_0/file0_0.txt")
88-
if p.exists():
89-
p.unlink()
83+
assert not p.exists()
9084

9185

9286
def test_transfer_config_live(s3_rig, tmp_path):

0 commit comments

Comments
 (0)