File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
2
from pathlib import Path
3
+ from statistics import StatisticsError
3
4
import scipy
4
5
import csv
5
6
import json
@@ -73,6 +74,30 @@ def test_setup_scenario(self):
73
74
def test_setup_causal_specification (self ):
74
75
self .assertIsInstance (self .json_class .causal_specification , CausalSpecification )
75
76
77
+ def test_f_flag (self ):
78
+ example_test = {
79
+ "tests" : [
80
+ {
81
+ "name" : "test1" ,
82
+ "mutations" : {"test_input" : "Increase" },
83
+ "estimator" : "LinearRegressionEstimator" ,
84
+ "estimate_type" : "ate" ,
85
+ "effect_modifiers" : [],
86
+ "expectedEffect" : {"test_output" : "NoEffect" },
87
+ "skip" : False ,
88
+ }
89
+ ]
90
+ }
91
+ self .json_class .test_plan = example_test
92
+ effects = {"NoEffect" : NoEffect ()}
93
+ mutates = {
94
+ "Increase" : lambda x : self .json_class .scenario .treatment_variables [x ].z3
95
+ > self .json_class .scenario .variables [x ].z3
96
+ }
97
+ estimators = {"LinearRegressionEstimator" : LinearRegressionEstimator }
98
+ with self .assertRaises (StatisticsError ):
99
+ self .json_class .generate_tests (effects , mutates , estimators , True )
100
+
76
101
def test_generate_tests_from_json (self ):
77
102
example_test = {
78
103
"tests" : [
You can’t perform that action at this time.
0 commit comments