From f6e5b5109ce0466a812e3374658a4c615257564d Mon Sep 17 00:00:00 2001 From: Jian Yuan Lee Date: Fri, 4 Aug 2023 22:05:16 +0100 Subject: [PATCH] use cast() --- .../sentry/integrations/github_enterprise/test_client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/sentry/integrations/github_enterprise/test_client.py b/tests/sentry/integrations/github_enterprise/test_client.py index 95c1bf9773b139..2ec8fbea5e4e8a 100644 --- a/tests/sentry/integrations/github_enterprise/test_client.py +++ b/tests/sentry/integrations/github_enterprise/test_client.py @@ -1,4 +1,5 @@ import base64 +from typing import cast from unittest import mock import pytest @@ -66,7 +67,10 @@ def setUp(self): external_id=123, integration_id=integration.id, ) - self.install = integration.get_installation(organization_id=self.organization.id) + self.install = cast( + GitHubEnterpriseIntegration, + integration.get_installation(organization_id=self.organization.id), + ) assert isinstance(self.install, GitHubEnterpriseIntegration) self.gh_client = self.install.get_client() responses.add( @@ -116,7 +120,6 @@ def test_get_stacktrace_link(self): json={"text": 200}, ) - assert isinstance(self.install, GitHubEnterpriseIntegration) source_url = self.install.get_stacktrace_link(self.repo, path, "master", version) assert ( source_url @@ -145,7 +148,6 @@ def test_get_codeowner_file(self, mock_check_file): url=url, json={"content": base64.b64encode(GITHUB_CODEOWNERS["raw"].encode()).decode("ascii")}, ) - assert isinstance(self.install, GitHubEnterpriseIntegration) result = self.install.get_codeowner_file( self.config.repository, ref=self.config.default_branch )