From f9a075fcd96756bf660eb3e2b4ad0b12a339bf5a Mon Sep 17 00:00:00 2001 From: meyerscetbon <40204805+meyerscetbon@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:09:49 +0000 Subject: [PATCH] Fix the usage of tempfile in test_generate_data Replace mktemp with mkstemp --- test/data_generation/test_generate_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data_generation/test_generate_data.py b/test/data_generation/test_generate_data.py index 85b5d5a..bac9118 100644 --- a/test/data_generation/test_generate_data.py +++ b/test/data_generation/test_generate_data.py @@ -177,7 +177,7 @@ def test_generate_sem_variable_groups(five_variable_two_dim_metadata: VariablesM def test_generate_sem_numpy(five_node_graph: torch.Tensor, five_variable_one_dim_metadata: VariablesMetadata): - tmpfile = tempfile.mktemp() + ".npy" + tmpfile = tempfile.mkstemp(suffix=".npy")[1] np.save(tmpfile, five_node_graph.numpy()) assert os.path.exists(tmpfile)