diff --git a/tests/attributes/test_datetime_column_load_from_csv.py b/tests/attributes/test_datetime_column_load_from_csv.py index 14ae1f7..b602a49 100644 --- a/tests/attributes/test_datetime_column_load_from_csv.py +++ b/tests/attributes/test_datetime_column_load_from_csv.py @@ -83,6 +83,7 @@ def test_load_column_with_valid_datetime_utc(self): with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file: sample_df.to_csv(temp_file) + temp_file.seek(0) read_df = pd.read_csv(temp_file.name) self.__assert_values__( @@ -102,8 +103,9 @@ def test_load_column_with_valid_datetime_naive(self): sample_df = pd.DataFrame([{random_column_id: naive_datetime}]) - with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file: + with tempfile.NamedTemporaryFile(suffix=".csv", mode="w+") as temp_file: sample_df.to_csv(temp_file) + temp_file.seek(0) read_df = pd.read_csv(temp_file.name) self.__assert_values__( @@ -129,6 +131,7 @@ def test_load_column_with_valid_datetime_not_utc(self): with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file: # write csv to temporary location and read to simulate df read sample_df.to_csv(temp_file) + temp_file.seek(0) read_df = pd.read_csv(temp_file.name) self.__assert_values__( @@ -153,6 +156,7 @@ def test_load_column_with_invalid_datetime(self): with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file: # write csv to temporary location and read to simulate df read sample_df.to_csv(temp_file) + temp_file.seek(0) read_df = pd.read_csv(temp_file.name) self.__assert_values__(