Skip to content

Commit

Permalink
test incompatible settings ascii_tables & tbl_formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhem-dvr committed Nov 7, 2024
1 parent fe028eb commit c9653a5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions py-polars/tests/unit/dataframe/test_show.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

import polars as pl
from polars.config import TableFormatNames


def test_df_show_default(capsys: pytest.CaptureFixture[str]) -> None:
Expand Down Expand Up @@ -134,6 +135,24 @@ def test_df_show_ascii_tables(capsys: pytest.CaptureFixture[str]) -> None:
)


@pytest.mark.parametrize(
("ascii_tables", "tbl_formatting"),
[
(True, "ASCII_FULL_CONDENSED"),
(True, "UTF8_FULL_CONDENSED"),
(False, "ASCII_FULL_CONDENSED"),
(False, "UTF8_FULL_CONDENSED"),
],
)
def test_df_show_cannot_set_ascii_tables_and_tbl_formatting(
ascii_tables: bool, tbl_formatting: TableFormatNames
) -> None:
df = pl.DataFrame()

with pytest.raises(ValueError):
df.show(ascii_tables=ascii_tables, tbl_formatting=tbl_formatting)


@pl.Config(decimal_separator=",")
def test_df_show_decimal_separator(capsys: pytest.CaptureFixture[str]) -> None:
df = pl.DataFrame({"v": [9876.54321, 1010101.0, -123456.78]})
Expand Down

0 comments on commit c9653a5

Please sign in to comment.