From 6c1fca3c14f42849de0030a384192364ebecde92 Mon Sep 17 00:00:00 2001 From: Liz Gehret Date: Thu, 17 Oct 2024 15:01:23 -0600 Subject: [PATCH] better approach --- rescript/tests/test_ncbi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rescript/tests/test_ncbi.py b/rescript/tests/test_ncbi.py index d0e2260..fc9821c 100644 --- a/rescript/tests/test_ncbi.py +++ b/rescript/tests/test_ncbi.py @@ -238,7 +238,16 @@ def test_ncbi_fails(self): 'o__Boletales; f__Boletaceae; g__Boletus; s__edulis' ) exp_log_segment = 'Retrying' - self.assertTrue(exp_log_segment in line for line in log.output) + for line in log.output: + if exp_log_segment in line: + result = True + break + else: + result = False + self.assertTrue( + result, + f'`{exp_log_segment}` not found in the output log.' + ) def test_get_ncbi_dirty_tricks(self): with self.assertLogs(level='WARNING') as log: