From 92fe50f786c463c16a2f201ba29e81e0d445fd48 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Sat, 18 May 2024 11:58:01 -0700 Subject: [PATCH] Don't use `/tmp` Windows OS does not support `/tmp`. --- pelicun/tests/validation/1/test_1.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pelicun/tests/validation/1/test_1.py b/pelicun/tests/validation/1/test_1.py index c42ea330e..938bb19c0 100644 --- a/pelicun/tests/validation/1/test_1.py +++ b/pelicun/tests/validation/1/test_1.py @@ -44,6 +44,7 @@ """ +import tempfile import numpy as np import pandas as pd import pelicun @@ -159,6 +160,7 @@ def test_validation_ds_probabilities(): asmnt.damage.ds_model.sample = asmnt.damage.ds_model.sample.iloc[0:100, :] # (we reduce the number of realizations to conserve resources) before = asmnt.damage.ds_model.sample.copy() - asmnt.damage.save_sample('/tmp/mdl.csv') - asmnt.damage.load_sample('/tmp/mdl.csv') + temp_dir = tempfile.mkdtemp() + asmnt.damage.save_sample(f'{temp_dir}/mdl.csv') + asmnt.damage.load_sample(f'{temp_dir}/mdl.csv') pd.testing.assert_frame_equal(before, asmnt.damage.ds_model.sample)