Skip to content

Commit

Permalink
fixed tests missing pyarrow dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Sep 14, 2022
1 parent d75b4d5 commit 7819629
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pantab/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

def test_bad_table_mode_raises(df, tmp_hyper, use_parquet):
if use_parquet:
pytest.importorskip("pyarrow")
df = df.drop(columns=["timedelta64"])

msg = "'table_mode' must be either 'w' or 'a'"
Expand All @@ -24,6 +25,7 @@ def test_bad_table_mode_raises(df, tmp_hyper, use_parquet):

def test_append_mode_raises_column_mismatch(df, tmp_hyper, table_name, use_parquet):
if use_parquet:
pytest.importorskip("pyarrow")
df = df.drop(columns=["timedelta64"])

pantab.frame_to_hyper(df, tmp_hyper, table=table_name, use_parquet=use_parquet)
Expand All @@ -40,6 +42,7 @@ def test_append_mode_raises_column_dtype_mismatch(
df, tmp_hyper, table_name, use_parquet
):
if use_parquet:
pytest.importorskip("pyarrow")
df = df.drop(columns=["timedelta64"])

pantab.frame_to_hyper(df, tmp_hyper, table=table_name, use_parquet=use_parquet)
Expand All @@ -56,6 +59,7 @@ def test_failed_write_doesnt_overwrite_file(
df, tmp_hyper, monkeypatch, table_mode, use_parquet
):
if use_parquet:
pytest.importorskip("pyarrow")
df = df.drop(columns=["timedelta64"])

pantab.frame_to_hyper(
Expand All @@ -68,6 +72,7 @@ def failure(*args, **kwargs):
raise ValueError("dummy failure")

if use_parquet:
pytest.importorskip("pyarrow")
pytest.skip("TODO: should figure out patching here")
# monkeypatch.setattr(pantab._writer.pq, "write_table", failure, raising=True)
else:
Expand Down

0 comments on commit 7819629

Please sign in to comment.