Skip to content

Commit

Permalink
Fix the usage of tempfile in test_generate_data
Browse files Browse the repository at this point in the history
Replace mktemp with mkstemp
  • Loading branch information
meyerscetbon authored Feb 13, 2024
1 parent 6954849 commit f9a075f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/data_generation/test_generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f9a075f

Please sign in to comment.