Skip to content

Commit a6e4dc8

Browse files
committed
make warning less scary
1 parent 4b1a2f3 commit a6e4dc8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

codeflash/verification/parse_test_output.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def calculate_function_throughput_from_test_results(test_results: TestResults, f
6767
def parse_test_return_values_bin(file_location: Path, test_files: TestFiles, test_config: TestConfig) -> TestResults:
6868
test_results = TestResults()
6969
if not file_location.exists():
70-
logger.warning(f"No test results for {file_location} found.")
70+
logger.debug(f"No test results for {file_location} found.")
7171
console.rule()
7272
return test_results
7373

@@ -237,6 +237,9 @@ def parse_test_xml(
237237

238238
test_class_path = testcase.classname
239239
try:
240+
if testcase.name is None:
241+
logger.debug(f"testcase.name is None for testcase {testcase!r} in file {test_xml_file_path}, skipping")
242+
continue
240243
test_function = testcase.name.split("[", 1)[0] if "[" in testcase.name else testcase.name
241244
except (AttributeError, TypeError) as e:
242245
msg = (
@@ -273,16 +276,16 @@ def parse_test_xml(
273276

274277
timed_out = False
275278
if test_config.test_framework == "pytest":
276-
loop_index = int(testcase.name.split("[ ")[-1][:-2]) if "[" in testcase.name else 1
279+
loop_index = int(testcase.name.split("[ ")[-1][:-2]) if testcase.name and "[" in testcase.name else 1
277280
if len(testcase.result) > 1:
278-
logger.warning(f"!!!!!Multiple results for {testcase.name} in {test_xml_file_path}!!!")
281+
logger.debug(f"!!!!!Multiple results for {testcase.name or '<None>'} in {test_xml_file_path}!!!")
279282
if len(testcase.result) == 1:
280283
message = testcase.result[0].message.lower()
281284
if "failed: timeout >" in message:
282285
timed_out = True
283286
else:
284287
if len(testcase.result) > 1:
285-
logger.warning(f"!!!!!Multiple results for {testcase.name} in {test_xml_file_path}!!!")
288+
logger.debug(f"!!!!!Multiple results for {testcase.name or '<None>'} in {test_xml_file_path}!!!")
286289
if len(testcase.result) == 1:
287290
message = testcase.result[0].message.lower()
288291
if "timed out" in message:

0 commit comments

Comments
 (0)