-
Notifications
You must be signed in to change notification settings - Fork 19
Choking on parametrized tests with pandas.DataFrame #57
Copy link
Copy link
Open
Description
With v3, when I'm using a pandas.DataFrame in the parameters of one of my test function I end up with an error:
`ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()``
I'm not sure why it was revealed by v3, but I will send a fix as I believe get_parametrized_fixtures only need to collect parameters if they are strings.
Full repro file:
import pandas as pd
import pytest
@pytest.mark.parametrize(
"input_df,expected",
[(pd.DataFrame([{"a": 1}, {"a": 2}]), 3), (pd.DataFrame([{"a": 5}, {"a": 2}]), 7)]
)
def test_me(input_df: pd.DataFrame, expected: int) -> None:
...Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels