Skip to content

Commit a6090fc

Browse files
committed
Fixes flakey unit test
So this test will change based on the installed environment. Changing to mirror what module does.
1 parent 4858121 commit a6090fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/plugins/test_polars_extensions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
PolarsSpreadsheetWriter,
2424
)
2525

26+
try:
27+
from xlsxwriter.workbook import Workbook
28+
except ImportError:
29+
Workbook = typing.Type
30+
2631

2732
@pytest.fixture
2833
def df():
@@ -175,4 +180,4 @@ def test_polars_spreadsheet(df: pl.DataFrame, tmp_path: pathlib.Path) -> None:
175180
def test_getting_type_hints_spreadsheetwriter():
176181
"""Tests that types can be resolved at run time."""
177182
type_hints = typing.get_type_hints(PolarsSpreadsheetWriter)
178-
assert type_hints["workbook"] == typing.Union[typing.Type, io.BytesIO, pathlib.Path, str]
183+
assert type_hints["workbook"] == typing.Union[Workbook, io.BytesIO, pathlib.Path, str]

0 commit comments

Comments
 (0)