Skip to content

Commit 8d7570e

Browse files
Add test case for no covariate
1 parent 0888672 commit 8d7570e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testing_tests/test_estimators.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,11 @@ def test_no_treatment_variable_in_formula(self):
522522
regression_estimator.formula = "Y ~ A + Z"
523523
with self.assertRaises(ValueError):
524524
self.regression_estimator.get_terms_from_formula()
525+
526+
527+
def test_no_covariate_in_formula(self):
528+
regression_estimator = self.regression_estimator
529+
regression_estimator.formula = "Y ~ X"
530+
outcome, treatment, covariates = self.regression_estimator.get_terms_from_formula()
531+
self.assertEqual(outcome, "Y")
532+
self.assertEqual(treatment, "X")

0 commit comments

Comments
 (0)