File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ class BaseTestCase:
17
17
treatment_variable : Variable
18
18
outcome_variable : Variable
19
19
effect : str = Effect .TOTAL .value
20
+
21
+ def __post_init__ (self ):
22
+ if self .treatment_variable == self .outcome_variable :
23
+ raise ValueError (f"Treatment variable { self .treatment_variable } cannot also be the outcome variable." )
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ def setUp(self) -> None:
98
98
def tearDown (self ) -> None :
99
99
shutil .rmtree (self .temp_dir_path )
100
100
101
+ def test_invalid_base_test_case (self ):
102
+ with self .assertRaises (ValueError ):
103
+ BaseTestCase (self .A , self .A )
104
+
101
105
def test_check_minimum_adjustment_set (self ):
102
106
"""Check that the minimum adjustment set is correctly made"""
103
107
minimal_adjustment_set = self .causal_dag .identification (self .base_test_case_A_C )
You can’t perform that action at this time.
0 commit comments