Skip to content

Commit 2a9b516

Browse files
committed
add warning tests for binary outcome
1 parent 1096069 commit 2a9b516

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doubleml/plm/tests/test_plr_binary_outcome.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ def generate_binary_data():
5050
return data
5151

5252

53+
@pytest.mark.ci
54+
def test_dml_plr_binary_warnings(generate_binary_data, learner_binary, score):
55+
data = generate_binary_data
56+
obj_dml_data = dml.DoubleMLData(data, "y", ["d"])
57+
msg = "The ml_m learner {str(ml_m)} was identified as classifier ' \
58+
'but at least one treatment variable is not binary with values 0 and 1.'"
59+
with pytest.warns(UserWarning, match=msg):
60+
_ = dml.DoubleMLPLR(obj_dml_data, clone(learner_binary), clone(learner_binary), score=score)
61+
62+
5363
@pytest.fixture(scope="module")
5464
def dml_plr_binary_fixture(generate_binary_data, learner_binary, score):
5565
boot_methods = ["normal"]

0 commit comments

Comments
 (0)