Skip to content

Commit 968c59f

Browse files
committed
STY: Move BytesIO import to top of test_encryption.py
1 parent 2df3d40 commit 968c59f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/test_encryption.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test the pypdf._encryption module."""
22
import secrets
3+
from io import BytesIO
34

45
import pytest
56

@@ -395,8 +396,6 @@ def test_perms_valid_true_for_v4():
395396
"""perms_valid defaults to True for V4 encryption (no /Perms field)."""
396397
writer = PdfWriter(clone_from=RESOURCE_ROOT / "encryption" / "unencrypted.pdf")
397398
writer.encrypt(user_password="user", owner_password="owner", algorithm="RC4-128")
398-
from io import BytesIO
399-
400399
output = BytesIO()
401400
writer.write(output)
402401
reader = PdfReader(output)
@@ -407,8 +406,6 @@ def test_perms_valid_true_for_v4():
407406
@pytest.mark.skipif(not HAS_AES, reason="No AES implementation")
408407
def test_perms_valid_false_when_tampered():
409408
"""perms_valid is False when /Perms has been tampered with."""
410-
from io import BytesIO
411-
412409
writer = PdfWriter(clone_from=RESOURCE_ROOT / "encryption" / "unencrypted.pdf")
413410
writer.encrypt(user_password="user", owner_password="owner", algorithm="AES-256")
414411
output = BytesIO()

0 commit comments

Comments
 (0)