Skip to content

Commit

Permalink
Merge pull request #1530 from cbm755/test_droppings
Browse files Browse the repository at this point in the history
test was leaving a file behind
  • Loading branch information
JorjMcKie authored Jan 12, 2022
2 parents 6b3c598 + db71007 commit f0a614e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/test_pixmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,15 @@ def test_pilsave():
pass


def test_save():
def test_save(tmpdir):
# pixmaps from file then save to image
# make pixmap from this and confirm equality
pix1 = fitz.Pixmap(imgfile)
stream2 = pix1.tobytes("png")
fp = tempfile.TemporaryFile()
pix1.save(str(fp.name), output="png")
try:
os.remove(fp.name)
except:
pass
outfile = os.path.join(tmpdir, "foo.png")
pix1.save(outfile, output="png")
# read it back
pix2 = fitz.Pixmap(outfile)
assert repr(pix1) == repr(pix2)


def test_setalpha():
Expand Down

0 comments on commit f0a614e

Please sign in to comment.