Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
rquidute committed Dec 2, 2024
1 parent ad279cf commit 25aab00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def proccess_commands_sdk_container(
) -> None:
complete_json = []
errors_found: list[str] = []
warning_found: list[str] = []
warnings_found: list[str] = []
test_function_count = 0
invalid_test_function_count = 0

Expand All @@ -116,11 +116,11 @@ async def proccess_commands_sdk_container(
json_data = json.load(json_file)

errors_found.append(
f"Failed running command: {command}.\nError message: {json_data['detail']}"
f"Failed running command: {command}.\n"
f"Error message: {json_data['detail']}"
)
except:
pass
continue
finally:
continue

with open(JSON_OUTPUT_FILE_PATH, "r") as json_file:
json_data = json.load(json_file)
Expand All @@ -132,8 +132,10 @@ async def proccess_commands_sdk_container(
function = json_dict["function"]
if not function.startswith("test_TC_"):
invalid_test_function_count += 1
warning_found.append(
f"Warning: File path: {json_dict['path']} Class: {json_dict['class_name']}. Invalid test function: {function}"
warnings_found.append(
f"Warning: File path: {json_dict['path']} "
f"Class: {json_dict['class_name']}. "
f"Invalid test function: {function}"
)
complete_json.append(json_dict)

Expand All @@ -158,8 +160,8 @@ async def proccess_commands_sdk_container(
f"{invalid_test_function_count}"
)
)
if len(warning_found) > 0:
print(*warning_found, sep="\n")
if len(warnings_found) > 0:
print(*warnings_found, sep="\n")
error_count = len(errors_found)
print(f">>>>>>>> Total of scripts with error: {error_count}")
if error_count > 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def main() -> None:
with open(TEST_INFO_JSON_PATH, "w") as f:
json.dump(info, f, indent=4)
else:
# TODO: find a better solution. This is a temporary workaround since Python Tests
# TODO: find a better solution.
# This is a temporary workaround since Python Tests
# are generating a big amount of log
with open(EXECUTION_LOG_OUTPUT, "w") as f:
with redirect_stdout(f):
Expand Down

0 comments on commit 25aab00

Please sign in to comment.