Skip to content

Commit

Permalink
Merge branch 'Fix2379' into permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
pubpub-zz committed Jan 6, 2024
2 parents 85ab279 + c95c4a0 commit 8f53c26
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def writer_operate(writer: PdfWriter) -> None:
)
def test_writer_operations_by_traditional_usage(convert, needs_cleanup):
if callable(convert):
write_data_here = convert(NamedTemporaryFile(suffix=".pdf", delete=False).name)
with NamedTemporaryFile(suffix=".pdf", delete=False) as fo:
write_data_here = convert(fo.name)
else:
write_data_here = convert

Expand Down Expand Up @@ -254,7 +255,8 @@ def test_writer_operations_by_traditional_usage(convert, needs_cleanup):
)
def test_writer_operations_by_semi_traditional_usage(convert, needs_cleanup):
if callable(convert):
write_data_here = convert(NamedTemporaryFile(suffix=".pdf", delete=False).name)
with NamedTemporaryFile(suffix=".pdf", delete=False) as fo:
write_data_here = convert(fo.name)
else:
write_data_here = convert

Expand All @@ -281,11 +283,10 @@ def test_writer_operations_by_semi_traditional_usage(convert, needs_cleanup):
(BytesIO(), False),
],
)
def test_writer_operations_by_semi_new_traditional_usage(
convert, needs_cleanup
):
def test_writer_operations_by_semi_new_traditional_usage(convert, needs_cleanup):
if callable(convert):
write_data_here = convert(NamedTemporaryFile(suffix=".pdf", delete=False).name)
with NamedTemporaryFile(suffix=".pdf", delete=False) as fo:
write_data_here = convert(fo.name)
else:
write_data_here = convert

Expand All @@ -309,7 +310,8 @@ def test_writer_operations_by_semi_new_traditional_usage(
)
def test_writer_operation_by_new_usage(convert, needs_cleanup):
if callable(convert):
write_data_here = convert(NamedTemporaryFile(suffix=".pdf", delete=False).name)
with NamedTemporaryFile(suffix=".pdf", delete=False) as fo:
write_data_here = convert(fo.name)
else:
write_data_here = convert

Expand Down

0 comments on commit 8f53c26

Please sign in to comment.