Skip to content

Commit

Permalink
Add error validation to test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosvm13 authored Dec 20, 2023
1 parent a1ac6d8 commit 8e58d37
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_pandas_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2065,11 +2065,14 @@ def test_df_add_prefix(kx, q):
q_add_prefix = kt.add_prefix("col_", axis=1)
assert(q('~', q_add_prefix, kt.pd().add_prefix("col_", axis=1)))

with pytest.raises(ValueError):
with pytest.raises(ValueError) as err:
t.add_prefix("col_", axis=0)
assert 'nyi' in str(err)

with pytest.raises(ValueError):
t.add_suffix("col_", axis=3)
with pytest.raises(ValueError) as err:
t.add_prefix("col_", axis=3)
assert 'No axis named 3' in str(err)


def test_df_add_suffix(kx, q):
t = q('([] til 5; 5?5; 5?1f; (5;5)#100?" ")')
Expand All @@ -2083,11 +2086,14 @@ def test_df_add_suffix(kx, q):
q_add_suffix = kt.add_suffix("_col", axis=1)
assert(q('~', q_add_suffix, kt.pd().add_suffix("_col", axis=1)))

with pytest.raises(ValueError):
with pytest.raises(ValueError) as err:
t.add_suffix("_col", axis=0)

with pytest.raises(ValueError):
assert 'nyi' in str(err)

with pytest.raises(ValueError) as err:
t.add_suffix("_col", axis=3)
assert 'No axis named 3' in str(err)


def test_pandas_skew(q):
tab = q('([] price: 250.0f - 100?500.0f; ints: 100 - 100?200)')
Expand Down

0 comments on commit 8e58d37

Please sign in to comment.