Skip to content

Commit

Permalink
Use tmp_path to avoid needing to unlink.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexaryn committed Oct 21, 2024
1 parent dafbafc commit 3d6b7dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2502,10 +2502,9 @@ def test_stream_not_closed():
assert not fileobj.closed


def test_auto_write():
def test_auto_write(tmp_path):
"""Another test for #2905"""
target = Path(_get_write_target(str))
target = tmp_path / "out.pdf"
with PdfWriter(target) as writer:
writer.add_blank_page(100, 100)
assert target.stat().st_size > 0
target.unlink()

0 comments on commit 3d6b7dc

Please sign in to comment.