Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes flakey unit test #781

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/plugins/test_polars_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
PolarsSpreadsheetWriter,
)

try:
from xlsxwriter.workbook import Workbook
except ImportError:
Workbook = typing.Type


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