From d3b736474539040a6da15b0e87ad2a0ceeea3de1 Mon Sep 17 00:00:00 2001 From: Caleb Grant Date: Thu, 8 Aug 2024 16:05:21 -0700 Subject: [PATCH] use temp xlsx file Signed-off-by: Caleb Grant --- tests/test_crosstab.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_crosstab.py b/tests/test_crosstab.py index fa45fa6..7c880fe 100644 --- a/tests/test_crosstab.py +++ b/tests/test_crosstab.py @@ -135,14 +135,14 @@ def test_crosstab_rows_single_value_column(temp_csv_file, temp_xlsx_file): """Test that values are correctly placed in the crosstab with one value column.""" Crosstab( incsv=temp_csv_file, - outxlsx=Path("test.xlsx"), + outxlsx=temp_xlsx_file, row_headers=("header1",), col_headers=("header2", "header3"), value_cols=("value",), keep_sqlite=False, keep_src=True, ).crosstab() - wb = openpyxl.load_workbook(Path("test.xlsx")) + wb = openpyxl.load_workbook(temp_xlsx_file) ws = wb["Crosstab"] # Check the row headers assert ws["A1"].value == "header2" @@ -179,14 +179,14 @@ def test_crosstab_rows_multi_value_column(temp_csv_file, temp_xlsx_file): """Test that values are correctly placed in the crosstab with multiple value columns.""" Crosstab( incsv=temp_csv_file, - outxlsx=Path("test.xlsx"), + outxlsx=Path(temp_xlsx_file), row_headers=("header1",), col_headers=("header2", "header3"), value_cols=("value", "unit"), keep_sqlite=False, keep_src=True, ).crosstab() - wb = openpyxl.load_workbook(Path("test.xlsx")) + wb = openpyxl.load_workbook(temp_xlsx_file) ws = wb["Crosstab"] # Check the row headers assert ws["A1"].value == "header2"