diff --git a/tests/test_tutorial/test_pandas_filter_rows.py b/tests/test_tutorial/test_pandas_filter_rows.py new file mode 100644 index 0000000..ab67076 --- /dev/null +++ b/tests/test_tutorial/test_pandas_filter_rows.py @@ -0,0 +1,20 @@ +from src.tutorial.testing.practice.pandas_filter_rows import filter_dataframe +import pytest +import pandas as pd + + +@pytest.fixture +def standard_df(): + df = pd.DataFrame( + { + "A": [1, 2, 3, 4, 5], + "B": [0, 2, 2, 4, 5], + "C": [1, 2, 3, 8, 5], + } + ) + return df + + +def test_col_not_in_dataframe(standard_df): + with pytest.raises(ValueError): + filter_dataframe(standard_df, "Z", lambda x: x >= 4)