Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit f9b5a2f

Browse files
1 parent d77a9cc commit f9b5a2f

4 files changed

Lines changed: 25 additions & 10 deletions

File tree

google/cloud/pubsub_v1/subscriber/scheduler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,16 @@ def shutdown(
168168
if sys.version_info < (3, 14):
169169
# For Python < 3.14, work_item.args is a tuple of positional arguments.
170170
# The message is expected to be the first argument.
171-
if hasattr(work_item, 'args') and work_item.args:
171+
if hasattr(work_item, "args") and work_item.args:
172172
dropped_message = work_item.args[0] # type: ignore[index]
173173
else:
174174
# For Python >= 3.14, work_item.task is (fn, args, kwargs).
175175
# The message is expected to be the first item in the args tuple (task[1]).
176-
if hasattr(work_item, 'task') and len(work_item.task) == 3 and work_item.task[1]:
176+
if (
177+
hasattr(work_item, "task")
178+
and len(work_item.task) == 3
179+
and work_item.task[1]
180+
):
177181
dropped_message = work_item.task[1][0]
178182

179183
if dropped_message is not None:

noxfile.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@ def install_unittest_dependencies(session, *constraints):
235235
def unit(session, protobuf_implementation):
236236
# Install all test dependencies, then install this package in-place.
237237

238-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
238+
if protobuf_implementation == "cpp" and session.python in (
239+
"3.11",
240+
"3.12",
241+
"3.13",
242+
"3.14",
243+
):
239244
session.skip("cpp implementation is not supported in python 3.11+")
240245

241246
constraints_path = str(
@@ -445,7 +450,12 @@ def docfx(session):
445450
def prerelease_deps(session, protobuf_implementation):
446451
"""Run all tests with prerelease versions of dependencies installed."""
447452

448-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
453+
if protobuf_implementation == "cpp" and session.python in (
454+
"3.11",
455+
"3.12",
456+
"3.13",
457+
"3.14",
458+
):
449459
session.skip("cpp implementation is not supported in python 3.11+")
450460

451461
# Install all dependencies
@@ -543,4 +553,4 @@ def prerelease_deps(session, protobuf_implementation):
543553
env={
544554
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
545555
},
546-
)
556+
)

samples/snippets/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# All versions used to test samples.
92-
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

tests/unit/pubsub_v1/publisher/test_publisher_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,18 +326,19 @@ def test_opentelemetry_flow_control_exception(creds, span_exporter):
326326
# Verify failed flow control span values.
327327
assert failed_fc_span.kind == trace.SpanKind.INTERNAL
328328
assert (
329-
failed_fc_span.parent.span_id
330-
== failed_create_span.get_span_context().span_id
329+
failed_fc_span.parent.span_id == failed_create_span.get_span_context().span_id
331330
)
332331
assert len(failed_fc_span.events) == 1
333332
assert failed_fc_span.events[0].name == "exception"
334333

335334
# Verify finished publish create span values
336335
assert failed_create_span.status.status_code == trace.StatusCode.ERROR
337-
assert len(failed_create_span.events) >= 1 # Should have at least 'publish start'
336+
assert len(failed_create_span.events) >= 1 # Should have at least 'publish start'
338337
assert failed_create_span.events[0].name == "publish start"
339338
# Check for exception event
340-
has_exception_event = any(event.name == "exception" for event in failed_create_span.events)
339+
has_exception_event = any(
340+
event.name == "exception" for event in failed_create_span.events
341+
)
341342
assert has_exception_event, "Exception event not found in failed create span"
342343

343344

0 commit comments

Comments
 (0)