We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6b3c598 + db71007 commit f0a614eCopy full SHA for f0a614e
tests/test_pixmap.py
@@ -64,17 +64,15 @@ def test_pilsave():
64
pass
65
66
67
-def test_save():
+def test_save(tmpdir):
68
# pixmaps from file then save to image
69
# make pixmap from this and confirm equality
70
pix1 = fitz.Pixmap(imgfile)
71
- stream2 = pix1.tobytes("png")
72
- fp = tempfile.TemporaryFile()
73
- pix1.save(str(fp.name), output="png")
74
- try:
75
- os.remove(fp.name)
76
- except:
77
- 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)
78
79
80
def test_setalpha():
0 commit comments