File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,30 @@ def test_ctf_batches(self):
171
171
172
172
self .assertEqual ([result ["passed" ] for result in all_results ], [True ])
173
173
174
+ def test_ctf_batches_exception_silent (self ):
175
+ framework = CausalTestingFramework (self .paths , query = "test_input < 0" )
176
+ framework .setup ()
177
+
178
+ # Load and run tests
179
+ framework .load_tests ()
180
+
181
+ output_files = []
182
+ with tempfile .TemporaryDirectory () as tmpdir :
183
+ for i , results in enumerate (framework .run_tests_in_batches (silent = True )):
184
+ temp_file_path = os .path .join (tmpdir , f"output_{ i } .json" )
185
+ framework .save_results (results , temp_file_path )
186
+ output_files .append (temp_file_path )
187
+ del results
188
+
189
+ # Now stitch the results together from the temporary files
190
+ all_results = []
191
+ for file_path in output_files :
192
+ with open (file_path , "r" , encoding = "utf-8" ) as f :
193
+ all_results .extend (json .load (f ))
194
+
195
+ self .assertEqual ([result ["passed" ] for result in all_results ], [False ])
196
+ self .assertEqual ([result ["result" ]["effect_measure" ] for result in all_results ], ["Error" ])
197
+
174
198
def test_ctf_batches_exception (self ):
175
199
framework = CausalTestingFramework (self .paths , query = "test_input < 0" )
176
200
framework .setup ()
You can’t perform that action at this time.
0 commit comments