Skip to content

Commit e18ca1c

Browse files
committed
add test for multiple narwhals fixtures at once
1 parent 1db05c9 commit e18ca1c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/testing/plugin_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ def test_unparam(nw_dataframe: DataFrameConstructor) -> None:
7171
result.assert_outcomes(errors=1)
7272

7373

74+
def test_multiple_frame_fixtures_raises(pytester: pytest.Pytester) -> None:
75+
pytester.makeconftest("")
76+
pytester.makepyfile("""
77+
from narwhals.testing.typing import DataFrameConstructor, LazyFrameConstructor
78+
79+
def test_too_many(
80+
nw_dataframe: DataFrameConstructor, nw_lazyframe: LazyFrameConstructor
81+
) -> None:
82+
pass
83+
""")
84+
result = pytester.runpytest_subprocess()
85+
result.assert_outcomes(errors=1)
86+
result.stdout.fnmatch_lines(
87+
["*A test may only request one narwhals frame fixture, got:*"]
88+
)
89+
90+
7491
def test_default_backends_env_var() -> None:
7592
with mock.patch.dict(
7693
"os.environ", {"NARWHALS_DEFAULT_BACKENDS": "pandas,polars[eager]"}

0 commit comments

Comments
 (0)