Skip to content

Commit 77bcef3

Browse files
committed
ran black
1 parent 12889e7 commit 77bcef3

File tree

5 files changed

+3
-14
lines changed

5 files changed

+3
-14
lines changed

posthog/exception_capture.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def capture_exception(self, exception, metadata=None):
7171
properties["$process_person_profile"] = False
7272
distinct_id = uuid.uuid4()
7373

74-
7574
self.client.capture_exception(exception, distinct_id, properties)
7675
except Exception as e:
7776
self.log.exception(f"Failed to capture exception: {e}")

posthog/exception_integrations/django.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class DjangoIntegration:
2727
identifier = "django"
2828

2929
def __init__(self, capture_exception_fn=None):
30-
3130
if DJANGO_VERSION < (4, 2):
3231
raise IntegrationEnablingError("Django 4.2 or newer is required.")
3332

@@ -55,7 +54,6 @@ def uninstall(self):
5554

5655

5756
class DjangoRequestExtractor:
58-
5957
def __init__(self, request):
6058
# type: (Any) -> None
6159
self.request = request

posthog/exception_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222

2323
if TYPE_CHECKING:
24-
2524
from types import FrameType, TracebackType
2625
from typing import ( # noqa: F401
2726
Any,

posthog/sentry/posthog_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def processor(event, hint):
4343
not not Hub.current.client.dsn and Dsn(Hub.current.client.dsn).project_id
4444
)
4545
if project_id:
46-
properties["$sentry_url"] = (
47-
f"{PostHogIntegration.prefix}{PostHogIntegration.organization}/issues/?project={project_id}&query={event['event_id']}"
48-
)
46+
properties[
47+
"$sentry_url"
48+
] = f"{PostHogIntegration.prefix}{PostHogIntegration.organization}/issues/?project={project_id}&query={event['event_id']}"
4949

5050
posthog.capture(posthog_distinct_id, "$exception", properties)
5151

posthog/test/test_client.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def test_basic_super_properties(self):
100100
self.assertEqual(msg["properties"]["source"], "repo-name")
101101

102102
def test_basic_capture_exception(self):
103-
104103
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
105104
client = self.client
106105
exception = Exception("test exception")
@@ -128,7 +127,6 @@ def test_basic_capture_exception(self):
128127
)
129128

130129
def test_basic_capture_exception_with_distinct_id(self):
131-
132130
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
133131
client = self.client
134132
exception = Exception("test exception")
@@ -156,7 +154,6 @@ def test_basic_capture_exception_with_distinct_id(self):
156154
)
157155

158156
def test_basic_capture_exception_with_correct_host_generation(self):
159-
160157
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
161158
client = Client(FAKE_TEST_API_KEY, on_error=self.set_fail, host="https://aloha.com")
162159
exception = Exception("test exception")
@@ -184,7 +181,6 @@ def test_basic_capture_exception_with_correct_host_generation(self):
184181
)
185182

186183
def test_basic_capture_exception_with_correct_host_generation_for_server_hosts(self):
187-
188184
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
189185
client = Client(FAKE_TEST_API_KEY, on_error=self.set_fail, host="https://app.posthog.com")
190186
exception = Exception("test exception")
@@ -212,7 +208,6 @@ def test_basic_capture_exception_with_correct_host_generation_for_server_hosts(s
212208
)
213209

214210
def test_basic_capture_exception_with_no_exception_given(self):
215-
216211
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
217212
client = self.client
218213
try:
@@ -249,10 +244,8 @@ def test_basic_capture_exception_with_no_exception_given(self):
249244
self.assertEqual(capture_call[2]["$exception_list"][0]["stacktrace"]["frames"][0]["in_app"], True)
250245

251246
def test_basic_capture_exception_with_no_exception_happening(self):
252-
253247
with mock.patch.object(Client, "capture", return_value=None) as patch_capture:
254248
with self.assertLogs("posthog", level="WARNING") as logs:
255-
256249
client = self.client
257250
client.capture_exception()
258251

0 commit comments

Comments
 (0)