File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -133,3 +133,23 @@ def test_doubleml_exception_confint():
133
133
dml_qte_confint .bootstrap ()
134
134
df_qte_ci = dml_qte_confint .confint (joint = True )
135
135
assert isinstance (df_qte_ci , pd .DataFrame )
136
+
137
+
138
+ @pytest .mark .ci
139
+ def test_doubleml_exception_p_adjust ():
140
+ dml_qte_p_adjust = DoubleMLQTE (dml_data_irm , RandomForestClassifier (), RandomForestClassifier ())
141
+
142
+ msg = r'Apply fit\(\) before p_adjust\(\).'
143
+ with pytest .raises (ValueError , match = msg ):
144
+ dml_qte_p_adjust .p_adjust ()
145
+ dml_qte_p_adjust .fit ()
146
+ msg = r'Apply bootstrap\(\) before p_adjust\("romano-wolf"\).'
147
+ with pytest .raises (ValueError , match = msg ):
148
+ dml_qte_p_adjust .p_adjust (method = 'romano-wolf' )
149
+ dml_qte_p_adjust .bootstrap ()
150
+ p_val = dml_qte_p_adjust .p_adjust (method = 'romano-wolf' )
151
+ assert isinstance (p_val , pd .DataFrame )
152
+
153
+ msg = "The p_adjust method must be of str type. 0.05 of type <class 'float'> was passed."
154
+ with pytest .raises (TypeError , match = msg ):
155
+ dml_qte_p_adjust .p_adjust (method = 0.05 )
You can’t perform that action at this time.
0 commit comments