From 515fe8d2ef4d82d4363ea15627299c7e585c2445 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 17 Mar 2026 13:28:11 +0500 Subject: [PATCH] Remove use of deprecated `tempfile.mktemp` --- src/bonsai/test/tool/test_project.py | 2 +- src/ifcpatch/test/test_ifcpatch.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bonsai/test/tool/test_project.py b/src/bonsai/test/tool/test_project.py index ae0a187080..e9e11f4656 100644 --- a/src/bonsai/test/tool/test_project.py +++ b/src/bonsai/test/tool/test_project.py @@ -365,7 +365,7 @@ class TestLoadingIfcSqlite(NewFile): sql_type="SQLite", ) patcher.patch() - tmp_file = Path(tempfile.mktemp(suffix=".ifcsqlite")) + tmp_file = Path(tempfile.mkstemp(suffix=".ifcsqlite")[1]) ifcpatch.write(patcher.get_output(), tmp_file) elements_with_meshes = [ diff --git a/src/ifcpatch/test/test_ifcpatch.py b/src/ifcpatch/test/test_ifcpatch.py index 4d7e98e55a..d0976965b6 100644 --- a/src/ifcpatch/test/test_ifcpatch.py +++ b/src/ifcpatch/test/test_ifcpatch.py @@ -52,10 +52,10 @@ class Test: assert output.by_type("IfcProject")[0].GlobalId == project.GlobalId assert output.by_type("IfcWall")[0].GlobalId == wall.GlobalId - output_path = Path(tempfile.mktemp()) + output_path = Path(tempfile.mkstemp()[1]) try: - assert not output_path.exists() + assert output_path.stat().st_size == 0 ifcpatch.write(patcher.get_output(), output_path) - assert output_path.exists() + assert output_path.stat().st_size != 0 finally: output_path.unlink()