mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Remove use of deprecated tempfile.mktemp
This commit is contained in:
@@ -365,7 +365,7 @@ class TestLoadingIfcSqlite(NewFile):
|
|||||||
sql_type="SQLite",
|
sql_type="SQLite",
|
||||||
)
|
)
|
||||||
patcher.patch()
|
patcher.patch()
|
||||||
tmp_file = Path(tempfile.mktemp(suffix=".ifcsqlite"))
|
tmp_file = Path(tempfile.mkstemp(suffix=".ifcsqlite")[1])
|
||||||
ifcpatch.write(patcher.get_output(), tmp_file)
|
ifcpatch.write(patcher.get_output(), tmp_file)
|
||||||
|
|
||||||
elements_with_meshes = [
|
elements_with_meshes = [
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ class Test:
|
|||||||
assert output.by_type("IfcProject")[0].GlobalId == project.GlobalId
|
assert output.by_type("IfcProject")[0].GlobalId == project.GlobalId
|
||||||
assert output.by_type("IfcWall")[0].GlobalId == wall.GlobalId
|
assert output.by_type("IfcWall")[0].GlobalId == wall.GlobalId
|
||||||
|
|
||||||
output_path = Path(tempfile.mktemp())
|
output_path = Path(tempfile.mkstemp()[1])
|
||||||
try:
|
try:
|
||||||
assert not output_path.exists()
|
assert output_path.stat().st_size == 0
|
||||||
ifcpatch.write(patcher.get_output(), output_path)
|
ifcpatch.write(patcher.get_output(), output_path)
|
||||||
assert output_path.exists()
|
assert output_path.stat().st_size != 0
|
||||||
finally:
|
finally:
|
||||||
output_path.unlink()
|
output_path.unlink()
|
||||||
|
|||||||
Reference in New Issue
Block a user