Skip to content

Commit

Permalink
Test for expected exception instead of xfail (#1114)
Browse files Browse the repository at this point in the history
* Use of pytest.raises #1109

* Implemented request change #1114

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix request change #1114

* Fix change request #1114

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Will Dean <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 24, 2024
1 parent bf86f2c commit 9b22791
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 9b22791

Please sign in to comment.