Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for expected exception instead of xfail #1114

Merged
merged 11 commits into from
Oct 24, 2024
11 changes: 7 additions & 4 deletions tests/test_model_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,15 @@ def test_fit_no_t(toy_X):
assert "posterior" in model_builder.idata.groups()


@pytest.mark.xfail
def test_fit_dup_Y(toy_X):
# create redundant target column in X
def test_fit_dup_Y(toy_X, toy_y):
toy_X = pd.concat((toy_X, toy_y), axis=1)
model_builder = ModelBuilderTest()
model_builder.fit(X=toy_X, chains=1, draws=100, tune=100)

with pytest.raises(
ValueError,
match="X includes a column named 'output', which conflicts with the target variable.",
):
model_builder.fit(X=toy_X, chains=1, draws=100, tune=100)


@pytest.mark.skipif(
Expand Down
Loading