Skip to content

Commit 9e5e00b

Browse files
committed
As reported in #42712, our usage of called_with is incorrect, thus, it was not testing what we intended.
Unfortunately, I have not been able to fix it in any of the cases.
1 parent 4a4c252 commit 9e5e00b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/sentry/tasks/test_derive_code_mappings.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ def generate_data(self, frames: List[Dict[str, Union[str, bool]]], platform: str
3939
class TestTaskBehavior(BaseDeriveCodeMappings):
4040
"""Test task behavior that is not language specific."""
4141

42-
@pytest.fixture(autouse=True)
43-
def inject_fixtures(self, caplog):
44-
self._caplog = caplog
45-
4642
def setUp(self):
4743
super().setUp()
4844
self.platform = "any"
@@ -57,11 +53,9 @@ def test_does_not_raise_installation_removed(self):
5753
side_effect=ApiError(
5854
'{"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app"}'
5955
),
60-
), patch("sentry.integrations.utils.code_mapping.logger") as logger:
56+
):
6157
assert derive_code_mappings(self.project.id, self.event_data) is None
6258

63-
assert logger.warning.called_with("The org has uninstalled the Sentry App.")
64-
6559
def test_raises_other_api_errors(self):
6660
with patch(
6761
"sentry.integrations.github.client.GitHubClientMixin.get_trees_for_org",
@@ -74,12 +68,10 @@ def test_unable_to_get_lock(self):
7468
with patch(
7569
"sentry.integrations.github.client.GitHubClientMixin.get_trees_for_org",
7670
side_effect=UnableToAcquireLock,
77-
), patch("sentry.integrations.utils.code_mapping.logger") as logger:
71+
):
7872
with pytest.raises(UnableToAcquireLock):
7973
derive_code_mappings(self.project.id, self.event_data)
8074

81-
assert logger.warning.called_with("derive_code_mappings.getting_lock_failed")
82-
8375

8476
class TestJavascriptDeriveCodeMappings(BaseDeriveCodeMappings):
8577
def setUp(self):

0 commit comments

Comments
 (0)