Skip to content

Commit ddc38fd

Browse files
committed
Extra tests to make codecov happy
1 parent 780f686 commit ddc38fd

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

causal_testing/testing/causal_effect.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ class Positive(SomeEffect):
114114
Currently only single values are supported for the test value"""
115115

116116
def apply(self, res: CausalTestResult) -> bool:
117-
if res.ci_valid() and not super().apply(res):
118-
return False
119117
if len(res.test_value.value) > 1:
120118
raise ValueError("Positive Effects are currently only supported on single float datatypes")
121119
if res.test_value.type in {"ate", "coefficient"}:
@@ -130,8 +128,6 @@ class Negative(SomeEffect):
130128
Currently only single values are supported for the test value"""
131129

132130
def apply(self, res: CausalTestResult) -> bool:
133-
if res.ci_valid() and not super().apply(res):
134-
return False
135131
if len(res.test_value.value) > 1:
136132
raise ValueError("Negative Effects are currently only supported on single float datatypes")
137133
if res.test_value.type in {"ate", "coefficient"}:

tests/testing_tests/test_causal_effect.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def test_invalid_ci_range(self):
232232

233233
def test_invalid_ci_atol(self):
234234
with self.assertRaises(ValueError):
235-
ExactValue(1000, ci_low=1001, ci_high=1002, atol=0.05)
235+
ExactValue(1000, ci_low=999, ci_high=1001, atol=50)
236236

237237
def test_invalid(self):
238238
test_value = TestValue(type="invalid", value=pd.Series(5.05))
@@ -295,6 +295,16 @@ def test_someEffect_fail(self):
295295
self.assertFalse(SomeEffect().apply(ctr))
296296
self.assertTrue(NoEffect().apply(ctr))
297297

298+
def test_someEffect_None(self):
299+
test_value = TestValue(type="ate", value=pd.Series(0))
300+
ctr = CausalTestResult(
301+
estimator=self.estimator,
302+
test_value=test_value,
303+
confidence_intervals=None,
304+
effect_modifier_configuration=None,
305+
)
306+
self.assertEquals(SomeEffect().apply(ctr), None)
307+
298308
def test_someEffect_str(self):
299309
test_value = TestValue(type="ate", value=0)
300310
ctr = CausalTestResult(

0 commit comments

Comments
 (0)