Skip to content

Commit d9775b8

Browse files
committed
Formatting from pr comments. Max line length=100
1 parent 22d1024 commit d9775b8

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

sentry_sdk/integrations/launchdarkly.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ class LaunchDarklyIntegration(Integration):
2424
def __init__(self, client=None):
2525
# type: (LDClient | None) -> None
2626
"""
27-
@param client An initialized LDClient instance. If a client is not provided, this integration will attempt to
28-
use the shared global instance. This will fail if ldclient.set_config() hasn't been called.
29-
30-
Docs reference: https://docs.launchdarkly.com/sdk/server-side/python
27+
:param client: An initialized LDClient instance. If a client is not provided, this
28+
integration will attempt to use the shared global instance.
3129
"""
3230
if client is None:
3331
try:

tests/integrations/launchdarkly/test_launchdarkly.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from sentry_sdk.integrations import DidNotEnable
1515
from sentry_sdk.integrations.launchdarkly import LaunchDarklyIntegration
1616

17-
# Docs reference: https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-testing.html#ldclient.integrations.test_data.TestData
18-
1917

2018
@pytest.mark.parametrize(
2119
"use_global_client",
@@ -55,16 +53,16 @@ def test_launchdarkly_integration_threaded(sentry_init):
5553
context = Context.create("user1")
5654

5755
def task(flag_key):
58-
# Create a new isolation scope for the thread. This means the evaluations in each task are captured separately.
56+
# Creates a new isolation scope for the thread.
57+
# This means the evaluations in each task are captured separately.
5958
with sentry_sdk.isolation_scope():
6059
client.variation(flag_key, context, False)
6160
return [f["flag"] for f in sentry_sdk.get_current_scope().flags.get()]
6261

6362
td.update(td.flag("hello").variation_for_all(True))
6463
td.update(td.flag("world").variation_for_all(False))
65-
client.variation(
66-
"hello", context, False
67-
) # Captured before splitting isolation scopes.
64+
# Capture an eval before we split isolation scopes.
65+
client.variation("hello", context, False)
6866

6967
with cf.ThreadPoolExecutor(max_workers=2) as pool:
7068
results = list(pool.map(task, ["world", "other"]))
@@ -99,7 +97,8 @@ async def runner():
9997

10098
def test_launchdarkly_integration_did_not_enable(monkeypatch):
10199
# Client is not passed in and set_config wasn't called.
102-
# Bad practice to access internals like this. TODO: can skip this test, or remove this case entirely (force user to pass in a client instance).
100+
# TODO: Bad practice to access internals like this. We can skip this test, or remove this
101+
# case entirely (force user to pass in a client instance).
103102
ldclient._reset_client()
104103
try:
105104
ldclient.__lock.lock()

0 commit comments

Comments
 (0)