Use new "with ()" style

This commit is contained in:
Bart Schuurmans 2024-03-29 14:25:08 +01:00
parent 0ac9d12d1c
commit 5d597f1ca9

View file

@ -233,8 +233,10 @@ class BookwyrmExportJob(TestCase):
models.bookwyrm_export_job.create_archive_task(job_id=self.job.id)
self.job.refresh_from_db()
with self.job.export_data.open("rb") as tar_file:
with BookwyrmTarFile.open(mode="r", fileobj=tar_file) as tar:
with (
self.job.export_data.open("rb") as tar_file,
BookwyrmTarFile.open(mode="r", fileobj=tar_file) as tar,
):
archive_json_file = tar.extractfile("archive.json")
data = json.load(archive_json_file)