@@ -104,15 +104,14 @@ def _create_abstract_test_case(self, test, mutates, effects):
104
104
)
105
105
return abstract_test
106
106
107
- def execute_tests (self , effects : dict , mutates : dict , estimators : dict , f_flag : bool ):
107
+ def generate_tests (self , effects : dict , mutates : dict , estimators : dict , f_flag : bool ):
108
108
"""Runs and evaluates each test case specified in the JSON input
109
109
110
110
:param effects: Dictionary mapping effect class instances to string representations.
111
111
:param mutates: Dictionary mapping mutation functions to string representations.
112
112
:param estimators: Dictionary mapping estimator classes to string representations.
113
113
:param f_flag: Failure flag that if True the script will stop executing when a test fails.
114
114
"""
115
- executed_tests = 0
116
115
failures = 0
117
116
for test in self .test_plan ["tests" ]:
118
117
if "skip" in test and test ["skip" ]:
@@ -127,13 +126,17 @@ def execute_tests(self, effects: dict, mutates: dict, estimators: dict, f_flag:
127
126
logger .info (abstract_test )
128
127
logger .info ([(v .name , v .distribution ) for v in abstract_test .treatment_variables ])
129
128
logger .info ("Number of concrete tests for test case: %s" , str (len (concrete_tests )))
130
- for concrete_test in concrete_tests :
131
- executed_tests += 1
132
- failed = self ._execute_test_case (concrete_test , estimators [test ["estimator" ]], f_flag )
133
- if failed :
134
- failures += 1
129
+ failures = self ._execute_tests (concrete_tests , estimators , test , f_flag )
135
130
136
- logger .info ("{%d}/{%d} failed" , failures , executed_tests )
131
+ logger .info ("{%d}/{%d} failed" , failures , str (len (concrete_tests )))
132
+
133
+ def _execute_tests (self , concrete_tests , estimators , test , f_flag ):
134
+ failures = 0
135
+ for concrete_test in concrete_tests :
136
+ failed = self ._execute_test_case (concrete_test , estimators [test ["estimator" ]], f_flag )
137
+ if failed :
138
+ failures += 1
139
+ return failures
137
140
138
141
def _json_parse (self ):
139
142
0 commit comments