From e23118e97f67a74b5885096cd7511d2565806cbb Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 28 May 2020 09:57:06 +0000 Subject: [PATCH] Fixed a temp file leak in the test suite. --- vasl_templates/webapp/tests/test_template_packs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vasl_templates/webapp/tests/test_template_packs.py b/vasl_templates/webapp/tests/test_template_packs.py index 95c5cf7..c0d07c4 100644 --- a/vasl_templates/webapp/tests/test_template_packs.py +++ b/vasl_templates/webapp/tests/test_template_packs.py @@ -2,13 +2,13 @@ import os import zipfile -import tempfile import base64 import re import random import pytest +from vasl_templates.webapp.utils import TempFile from vasl_templates.webapp.tests.test_vehicles_ordnance import add_vo from vasl_templates.webapp.tests.utils import \ select_tab, select_menu_option, set_player, \ @@ -215,7 +215,7 @@ def test_missing_templates( webapp, webdriver ): def _make_zip( files ): """Generate a ZIP file.""" - with tempfile.NamedTemporaryFile() as temp_file: + with TempFile() as temp_file: temp_file.close() with zipfile.ZipFile( temp_file.name, "w" ) as zip_file: for fname,fdata in files.items():