From 8e58d37e1164defd860d7e92141bc295f2373c1c Mon Sep 17 00:00:00 2001 From: marcosvm13 <61940472+marcosvm13@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:26:52 +0100 Subject: [PATCH] Add error validation to test --- tests/test_pandas_api.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_pandas_api.py b/tests/test_pandas_api.py index ba5a1fb..ae65874 100644 --- a/tests/test_pandas_api.py +++ b/tests/test_pandas_api.py @@ -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?" ")') @@ -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)')