From 69b60aa2ec3e38daa5c9e360bf302e95ad3dec70 Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Mon, 1 Jul 2024 20:04:30 +0200 Subject: [PATCH] Fix create tmp file in test_failed_extension test --- .../layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py b/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py index 1739a64ae577fa..3085a24c22c3ad 100644 --- a/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py +++ b/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py @@ -1123,8 +1123,9 @@ def test_failed_extension(self): from openvino.tools.mo import convert_model with self.assertRaisesRegex(Exception, ".*PyTorch Frontend doesn't support provided model type.*"): - with tempfile.NamedTemporaryFile() as tmpfile: + with tempfile.NamedTemporaryFile(delete=False) as tmpfile: convert_model(tmpfile.name, framework="pytorch") + os.remove(tmpfile.name) def create_pytorch_layer_norm(tmp_dir):