1
1
import unittest
2
2
from causal_testing .testing .causal_test_outcome import ExactValue , SomeEffect
3
3
from causal_testing .testing .causal_test_result import CausalTestResult , TestValue
4
-
4
+ from causal_testing . testing . estimators import LinearRegressionEstimator
5
5
6
6
class TestCausalTestOutcome (unittest .TestCase ):
7
7
"""Test the TestCausalTestOutcome basic methods."""
8
-
9
- def test_empty_adjustment_set (self ):
10
- ctr = CausalTestResult (
8
+ def setUp (self ) -> None :
9
+ self .estimator = LinearRegressionEstimator (
11
10
treatment = "A" ,
12
11
outcome = "A" ,
13
12
treatment_value = 1 ,
14
13
control_value = 0 ,
15
14
adjustment_set = {},
15
+ )
16
+ def test_empty_adjustment_set (self ):
17
+ ctr = CausalTestResult (
18
+ estimator = self .estimator ,
16
19
test_value = 0 ,
17
20
confidence_intervals = None ,
18
21
effect_modifier_configuration = None ,
@@ -24,11 +27,7 @@ def test_empty_adjustment_set(self):
24
27
def test_exactValue_pass (self ):
25
28
test_value = TestValue (type = "ate" , value = 5.05 )
26
29
ctr = CausalTestResult (
27
- treatment = "A" ,
28
- outcome = "A" ,
29
- treatment_value = 1 ,
30
- control_value = 0 ,
31
- adjustment_set = {},
30
+ estimator = self .estimator ,
32
31
test_value = test_value ,
33
32
confidence_intervals = None ,
34
33
effect_modifier_configuration = None ,
@@ -39,11 +38,7 @@ def test_exactValue_pass(self):
39
38
def test_exactValue_fail (self ):
40
39
test_value = TestValue (type = "ate" , value = 0 )
41
40
ctr = CausalTestResult (
42
- treatment = "A" ,
43
- outcome = "A" ,
44
- treatment_value = 1 ,
45
- control_value = 0 ,
46
- adjustment_set = {},
41
+ estimator = self .estimator ,
47
42
test_value = test_value ,
48
43
confidence_intervals = None ,
49
44
effect_modifier_configuration = None ,
@@ -54,11 +49,7 @@ def test_exactValue_fail(self):
54
49
def test_someEffect_pass (self ):
55
50
test_value = TestValue (type = "ate" , value = 5.05 )
56
51
ctr = CausalTestResult (
57
- treatment = "A" ,
58
- outcome = "A" ,
59
- treatment_value = 1 ,
60
- control_value = 0 ,
61
- adjustment_set = {},
52
+ estimator = self .estimator ,
62
53
test_value = test_value ,
63
54
confidence_intervals = [4.8 , 6.7 ],
64
55
effect_modifier_configuration = None ,
@@ -69,11 +60,7 @@ def test_someEffect_pass(self):
69
60
def test_someEffect_fail (self ):
70
61
test_value = TestValue (type = "ate" , value = 0 )
71
62
ctr = CausalTestResult (
72
- treatment = "A" ,
73
- outcome = "A" ,
74
- treatment_value = 1 ,
75
- control_value = 0 ,
76
- adjustment_set = {},
63
+ estimator = self .estimator ,
77
64
test_value = test_value ,
78
65
confidence_intervals = [- 0.1 , 0.2 ],
79
66
effect_modifier_configuration = None ,
0 commit comments