Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/sentry/issues/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_new_group_release_env(self) -> None:

def test_different_ids(self) -> None:
create_default_projects()
event_data = load_data("generic-event-profiling").data
event_data = load_data("generic-event-profiling")
project_id = event_data["event"].pop("project_id", self.project.id)
event_data["event"]["timestamp"] = timezone.now().isoformat()
event = self.store_event(data=event_data["event"], project_id=project_id)
Expand Down Expand Up @@ -444,7 +444,7 @@ def test_populates_feedback_metadata(self) -> None:
class SaveIssueOccurrenceToEventstreamTest(OccurrenceTestMixin, TestCase):
def test(self) -> None:
create_default_projects()
event_data = load_data("generic-event-profiling").data
event_data = load_data("generic-event-profiling")
project_id = event_data["event"].pop("project_id")
event_data["event"]["timestamp"] = timezone.now().isoformat()
event = self.store_event(data=event_data["event"], project_id=project_id)
Expand Down
9 changes: 4 additions & 5 deletions tests/sentry/models/test_processingissue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
)
from sentry.models.rawevent import RawEvent
from sentry.testutils.cases import TestCase
from sentry.utils.canonical import CanonicalKeyDict


class ProcessingIssueTest(TestCase):
Expand Down Expand Up @@ -76,7 +75,7 @@ def test_with_release_dist_pair_and_no_previous_issue(self):
raw_event = RawEvent.objects.create(
project_id=project.id,
event_id="abc",
data=CanonicalKeyDict({"release": release.version, "dist": dist.name}),
data={"release": release.version, "dist": dist.name},
)

manager = ProcessingIssueManager()
Expand Down Expand Up @@ -112,7 +111,7 @@ def test_with_release_dist_pair_and_previous_issue_without_release_dist(self):
raw_event = RawEvent.objects.create(
project_id=project.id,
event_id="abc",
data=CanonicalKeyDict({"release": release.version, "dist": dist.name}),
data={"release": release.version, "dist": dist.name},
)

ProcessingIssue.objects.create(
Expand Down Expand Up @@ -167,7 +166,7 @@ def test_with_release_dist_pair_and_previous_issue_with_release_dist(self):
raw_event = RawEvent.objects.create(
project_id=project.id,
event_id=event_id,
data=CanonicalKeyDict({"release": release, "dist": dist}),
data={"release": release, "dist": dist},
)

manager = ProcessingIssueManager()
Expand Down Expand Up @@ -205,7 +204,7 @@ def test_with_release_dist_pair_and_previous_issue_with_same_release_dist(self,
raw_event = RawEvent.objects.create(
project_id=project.id,
event_id="abc",
data=CanonicalKeyDict({"release": release.version, "dist": dist_2.name}),
data={"release": release.version, "dist": dist_2.name},
)

ProcessingIssue.objects.create(
Expand Down
6 changes: 0 additions & 6 deletions tests/sentry/utils/test_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pytest

from sentry.testutils.cases import TestCase
from sentry.utils.canonical import CanonicalKeyDict
from sentry.utils.safe import (
get_path,
safe_execute,
Expand Down Expand Up @@ -123,7 +122,6 @@ def test_get_path_dict(self):
assert get_path({"a": 2}, "b") is None
assert get_path({"a": {"b": []}}, "a", "b") == []
assert get_path({"a": []}, "a", "b") is None
assert get_path(CanonicalKeyDict({"a": 2}), "a") == 2

def test_get_default(self):
assert get_path({"a": 2}, "b", default=1) == 1
Expand Down Expand Up @@ -185,10 +183,6 @@ def test_set_dict(self):
assert set_path(data, "a", "b", value=42)
assert data == {"a": {"b": 42}}

data = CanonicalKeyDict({})
assert set_path(data, "a", value=42)
assert data == {"a": 42}

def test_set_default(self):
data = {"a": {"b": 2}}
assert not setdefault_path(data, "a", "b", value=42)
Expand Down
2 changes: 1 addition & 1 deletion tests/snuba/api/endpoints/test_organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -5987,7 +5987,7 @@ def test_all_events_fields(self):
"user.display": user_data["email"],
"device": "Mac",
"os": "",
"url": event.interfaces.data["request"].full_url,
"url": event.interfaces["request"].full_url,
"runtime": dict(event.get_raw_data()["tags"])["runtime"],
"replayId": replay_id.replace("-", ""),
"profile.id": profile_id.replace("-", ""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def store_transaction(
tags = []
if project_id is None:
project_id = self.project.id
event = load_data("transaction").copy()
event.data["tags"].extend(tags)
event = load_data("transaction")
event["tags"].extend(tags)
event.update(
{
"transaction": name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def store_transaction(
tags = []
if project_id is None:
project_id = self.project.id
event = load_data("transaction").copy()
event.data["tags"].extend(tags)
event = load_data("transaction")
event["tags"].extend(tags)
event.update(
{
"transaction": name,
Expand Down