From 1b866d83c937888e7011f24c171f3d27d1bbea81 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Tue, 5 Nov 2024 12:27:27 -0500 Subject: [PATCH] fix: typing and tests --- codecov_cli/services/report/__init__.py | 3 ++- tests/services/report/test_report_results.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/codecov_cli/services/report/__init__.py b/codecov_cli/services/report/__init__.py index 3e28c697..dea2a6cf 100644 --- a/codecov_cli/services/report/__init__.py +++ b/codecov_cli/services/report/__init__.py @@ -14,6 +14,7 @@ request_result, send_post_request, ) +from typing import Union logger = logging.getLogger("codecovcli") MAX_NUMBER_TRIES = 3 @@ -73,7 +74,7 @@ def create_report_results_logic( token: str, enterprise_url: str, fail_on_error: bool = False, - args: dict | None = None, + args: Union[dict, None] = None, ): encoded_slug = encode_slug(slug) sending_result = send_reports_result_request( diff --git a/tests/services/report/test_report_results.py b/tests/services/report/test_report_results.py index 27808d23..30992f5e 100644 --- a/tests/services/report/test_report_results.py +++ b/tests/services/report/test_report_results.py @@ -43,6 +43,7 @@ def test_report_results_command_with_warnings(mocker): assert res == mock_send_reports_result_request.return_value mock_send_reports_result_request.assert_called_with( + args=None, commit_sha="commit_sha", report_code="code", service="service", @@ -85,6 +86,7 @@ def test_report_results_command_with_error(mocker): ] assert res == mock_send_reports_result_request.return_value mock_send_reports_result_request.assert_called_with( + args=None, commit_sha="commit_sha", report_code="code", service="service",