test: test case for pandas filter roews (tutorial for fixture)
This commit is contained in:
parent
b5472e9716
commit
d4b184e993
20
tests/test_tutorial/test_pandas_filter_rows.py
Normal file
20
tests/test_tutorial/test_pandas_filter_rows.py
Normal file
@ -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)
|
||||||
Loading…
x
Reference in New Issue
Block a user