Skip to content

Commit 8b21043

Browse files
committed
Silent exception raising
1 parent c94733b commit 8b21043

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/main_tests/test_main.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,30 @@ def test_ctf_batches(self):
171171

172172
self.assertEqual([result["passed"] for result in all_results], [True])
173173

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+
174198
def test_ctf_batches_exception(self):
175199
framework = CausalTestingFramework(self.paths, query="test_input < 0")
176200
framework.setup()

0 commit comments

Comments
 (0)