From 6da05b40269ee919d666160881b88bd12caaecb2 Mon Sep 17 00:00:00 2001 From: hugovk Date: Thu, 11 Dec 2014 13:20:11 +0200 Subject: [PATCH] Use fp instead of filename --- Tests/test_psdraw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/test_psdraw.py b/Tests/test_psdraw.py index 04c32f23e..e59acc0e4 100644 --- a/Tests/test_psdraw.py +++ b/Tests/test_psdraw.py @@ -12,13 +12,14 @@ class TestPsDraw(PillowTestCase): from PIL import Image from PIL import PSDraw tempfile = self.tempfile('temp.ps') + fp = open(tempfile, "wb") im = Image.open("Tests/images/hopper.ppm") title = "hopper" box = (1*72, 2*72, 7*72, 10*72) # in points # Act - ps = PSDraw.PSDraw(tempfile) + ps = PSDraw.PSDraw(fp) ps.begin_document(title) # draw the image (75 dpi) @@ -31,6 +32,7 @@ class TestPsDraw(PillowTestCase): ps.text((4*72-w/2, 1*72-h), title) ps.end_document() + fp.close() # Assert # TODO