Skip to content

Commit efb91e4

Browse files
committed
poe lint
1 parent bf69154 commit efb91e4

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

tests/test_plugins.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,19 @@ async def test_worker_plugin_basic_config(client: Client) -> None:
150150
plugins=[MyWorkerPlugin()],
151151
)
152152
assert worker.config().get("task_queue") == "replaced_queue"
153-
assert [p.name() for p in worker.config().get("plugins")] == [MyWorkerPlugin().name()]
153+
assert [p.name() for p in worker.config().get("plugins", [])] == [
154+
MyWorkerPlugin().name()
155+
]
154156

155157
# Test client plugin propagation to worker plugins
156158
new_config = client.config()
157159
new_config["plugins"] = [MyCombinedPlugin()]
158160
client = Client(**new_config)
159161
worker = Worker(client, task_queue="queue", activities=[never_run_activity])
160162
assert worker.config().get("task_queue") == "combined"
161-
assert [p.name() for p in worker.config().get("plugins")] == [MyCombinedPlugin().name()]
163+
assert [p.name() for p in worker.config().get("plugins", [])] == [
164+
MyCombinedPlugin().name()
165+
]
162166

163167
# Test both. Client propagated plugins are called first, so the worker plugin overrides in this case
164168
worker = Worker(
@@ -168,7 +172,7 @@ async def test_worker_plugin_basic_config(client: Client) -> None:
168172
plugins=[MyWorkerPlugin()],
169173
)
170174
assert worker.config().get("task_queue") == "replaced_queue"
171-
assert [p.name() for p in worker.config().get("plugins")] == [
175+
assert [p.name() for p in worker.config().get("plugins", [])] == [
172176
MyCombinedPlugin().name(),
173177
MyWorkerPlugin().name(),
174178
]

tests/test_runtime.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
TelemetryFilter,
2222
)
2323
from temporalio.worker import Worker
24-
from tests.helpers import assert_eq_eventually, assert_eventually, find_free_port, worker_versioning_enabled
24+
from tests.helpers import (
25+
assert_eq_eventually,
26+
assert_eventually,
27+
find_free_port,
28+
worker_versioning_enabled,
29+
)
2530

2631

2732
@workflow.defn
@@ -260,8 +265,12 @@ async def check_metrics() -> None:
260265

261266

262267
def test_runtime_options_to_bridge_config() -> None:
263-
assert RuntimeOptions()._to_bridge_config().worker_heartbeat_interval_millis == 30_000
264-
bridge_config = RuntimeOptions(worker_heartbeat_interval=timedelta(seconds=60))._to_bridge_config()
268+
assert (
269+
RuntimeOptions()._to_bridge_config().worker_heartbeat_interval_millis == 30_000
270+
)
271+
bridge_config = RuntimeOptions(
272+
worker_heartbeat_interval=timedelta(seconds=60)
273+
)._to_bridge_config()
265274
assert bridge_config.worker_heartbeat_interval_millis == 60_000
266275

267276
bridge_config1 = RuntimeOptions(worker_heartbeat_interval=None)._to_bridge_config()

tests/worker/test_worker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,9 @@ async def test_can_run_autoscaling_polling_worker(
11391139
activity_pollers = [l for l in matches if "activity_task" in l]
11401140
assert len(activity_pollers) == 1
11411141
assert activity_pollers[0].endswith("2")
1142-
workflow_pollers = [l for l in matches if "workflow_task" in l and w.task_queue in l]
1142+
workflow_pollers = [
1143+
l for l in matches if "workflow_task" in l and w.task_queue in l
1144+
]
11431145
assert len(workflow_pollers) == 2
11441146
# There's sticky & non-sticky pollers, and they may have a count of 1 or 2 depending on
11451147
# initialization timing.

0 commit comments

Comments
 (0)