From c6e07a33b01b7b241113801971207660e05a20ea Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Wed, 11 Oct 2023 14:25:48 -0400 Subject: [PATCH] Modify parallelism test to use log file instead of captured stdout --- tests/integration_tests/test_dunder_main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/integration_tests/test_dunder_main.py b/tests/integration_tests/test_dunder_main.py index 816fe5c..252565f 100644 --- a/tests/integration_tests/test_dunder_main.py +++ b/tests/integration_tests/test_dunder_main.py @@ -113,11 +113,12 @@ def test_wrapper_with_custom_load_config(): def test_parallelism(r_light, caplog): - log = [] - for record in caplog.get_records("setup"): - line = record.message - if "R script started running." in line or "R script finished running." in line: - log.append(line) + scheduler = r_light + log_f = scheduler.wrapper.experiment_dir / "optimization.log" + with open(log_f, "r") as f: + log = f.readlines() + log = [line.strip() for line in log if "R script" in line] + found_parallelism = False for line in range(len(log) - 1): if "R script started running." in log[line] and "R script started running." in log[line + 1]: