From a0e7425fd4bc3f3954ebb38b4eb5832008634326 Mon Sep 17 00:00:00 2001 From: Eric Jolibois Date: Wed, 17 Jul 2024 15:02:13 +0200 Subject: [PATCH] test: rewrite a bit --- python/tests/test_fastexcel.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/python/tests/test_fastexcel.py b/python/tests/test_fastexcel.py index 6ffb471..ef8aff2 100644 --- a/python/tests/test_fastexcel.py +++ b/python/tests/test_fastexcel.py @@ -582,14 +582,11 @@ def test_null_values_in_cells() -> None: pd_assert_frame_equal(sheet.to_pandas(), pd_expected) -def test_bool_casting_to_string_for_polars() -> None: +def test_bool_casting_to_string() -> None: excel_reader = fastexcel.read_excel(path_for_fixture("sheet-bool.xlsx")) - - actual_polars_df = excel_reader.load_sheet(0, header_row=None, column_names=["0"]).to_polars() - expected_polars_df = pl.DataFrame( - { - "0": ["true", "false", "some string"], - } - ) - - pl_assert_frame_equal(actual_polars_df, expected_polars_df) + sheet = excel_reader.load_sheet(0, column_names=["col1"]) + expected = { + "col1": ["true", "false", "some string"], + } + pl_assert_frame_equal(sheet.to_polars(), pl.DataFrame(expected)) + pd_assert_frame_equal(sheet.to_pandas(), pd.DataFrame(expected))