Skip to content

Commit a7a5f23

Browse files
committed
wip testing no module
1 parent 440da10 commit a7a5f23

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

tests/test__formats_vals.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
import pandas as pd
2-
import polars as pl
1+
# import pandas as pd
2+
# import polars as pl
33
import pytest
44
from great_tables._formats_vals import _make_one_col_table
5-
from great_tables._tbl_data import to_list
5+
import sys
66

77

8-
@pytest.mark.parametrize("src", [1, [1], (1,), pd.Series([1]), pl.Series([1])])
9-
def test_roundtrip(src):
10-
gt = _make_one_col_table(src)
8+
# @pytest.mark.parametrize("src", [1, [1], (1,), pd.Series([1]), pl.Series([1])])
9+
# def test_roundtrip(src):
10+
# gt = _make_one_col_table(src)
1111

12-
assert to_list(gt._tbl_data["x"]) == [1]
12+
# assert to_list(gt._tbl_data["x"]) == [1]
13+
14+
15+
def test_one_column_table_no_lib() -> None:
16+
sys.modules["pandas"] = None
17+
18+
with pytest.raises(ModuleNotFoundError):
19+
import pandas
20+
21+
vals = [1, 2, 3]
22+
23+
_make_one_col_table(vals=vals)
24+
raise
25+
26+
27+
if __name__ == "__main__":
28+
pytest.main([__file__])

0 commit comments

Comments
 (0)