From 2262810aeba83385177d286365ecbd565595b23d Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sun, 24 May 2020 01:19:02 +0200 Subject: [PATCH] test.py: only unlink after close() because windows cannot unlink files with open handles on them --- test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index a2b2fb6..c3f6ab1 100644 --- a/test.py +++ b/test.py @@ -181,7 +181,6 @@ def test_cases(postersize, input_pagesize, output_pagesize, strategy, expected): os.unlink(infile) doc = fitz.open(outfile) - os.unlink(outfile) for pnum, (bbox, matrix) in zip(range(doc.pageCount), expected): xreflist = doc._getPageInfo(pnum, 3) @@ -214,3 +213,5 @@ def test_cases(postersize, input_pagesize, output_pagesize, strategy, expected): newmatrix = keyvals["/Matrix"].strip(" []").split() for v1, v2 in zip(matrix, newmatrix): assert math.isclose(float(v1), float(v2), abs_tol=0.00001) + doc.close() + os.unlink(outfile)