Skip to content

Commit 6262bb6

Browse files
committed
tests: move zipfile import to top-level to satisfy flake8 E402
1 parent bba6141 commit 6262bb6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/unit/test_coverage_improvements.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import json
77
import base64
8+
import zipfile
89
import pytest
910
from aioresponses import aioresponses
1011
from cryptography.hazmat.primitives import serialization, hashes
@@ -311,8 +312,6 @@ async def test_export_zip_png_detection():
311312
assert result == output_path
312313

313314
# Verify ZIP contains PNG
314-
import zipfile
315-
316315
with zipfile.ZipFile(output_path, "r") as zf:
317316
files = zf.namelist()
318317
assert "pictures/manifest.json" in files
@@ -351,8 +350,6 @@ async def test_export_zip_picture_decrypt_error():
351350
await client.export_data_zip(output_path, include_pictures=True)
352351

353352
# Should complete despite error
354-
import zipfile
355-
356353
with zipfile.ZipFile(output_path, "r") as zf:
357354
manifest = json.loads(zf.read("pictures/manifest.json"))
358355
# Error should be recorded
@@ -393,8 +390,6 @@ async def test_export_zip_location_decrypt_error():
393390
await client.export_data_zip(output_path, include_pictures=False)
394391

395392
# Should complete with error recorded
396-
import zipfile
397-
398393
with zipfile.ZipFile(output_path, "r") as zf:
399394
locations = json.loads(zf.read("locations.json"))
400395
assert "error" in locations[0]
@@ -980,7 +975,6 @@ async def test_export_zip_default_jpg_extension():
980975

981976
try:
982977
import tempfile
983-
import zipfile
984978

985979
with tempfile.NamedTemporaryFile(suffix=".zip", delete=False) as tmp:
986980
output_path = tmp.name

0 commit comments

Comments
 (0)