From e7629457b17af99f021765e1091865272c382bf2 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Tue, 17 Nov 2026 23:46:01 +0000 Subject: [PATCH 1/3] feat(spanner): Add Spanner Queue Send mutation sample Sending messages to a Spanner Queue via client mutations had Go and Java examples without a Python batch.send sample. --- spanner/queues/README.md | 27 ++++ spanner/queues/noxfile_config.py | 21 +++ spanner/queues/pyproject.toml | 30 +++++ spanner/queues/requirements-test.txt | 2 + spanner/queues/requirements.txt | 2 + spanner/queues/src/spanner_queues/__init__.py | 13 ++ .../src/spanner_queues/queue_send_message.py | 102 +++++++++++++++ spanner/queues/tests/__init__.py | 13 ++ spanner/queues/tests/conftest.py | 38 ++++++ .../queues/tests/queue_send_message_test.py | 123 ++++++++++++++++++ 10 files changed, 371 insertions(+) create mode 100644 spanner/queues/README.md create mode 100644 spanner/queues/noxfile_config.py create mode 100644 spanner/queues/pyproject.toml create mode 100644 spanner/queues/requirements-test.txt create mode 100644 spanner/queues/requirements.txt create mode 100644 spanner/queues/src/spanner_queues/__init__.py create mode 100644 spanner/queues/src/spanner_queues/queue_send_message.py create mode 100644 spanner/queues/tests/__init__.py create mode 100644 spanner/queues/tests/conftest.py create mode 100644 spanner/queues/tests/queue_send_message_test.py diff --git a/spanner/queues/README.md b/spanner/queues/README.md new file mode 100644 index 0000000000..cca8c44bad --- /dev/null +++ b/spanner/queues/README.md @@ -0,0 +1,27 @@ +# Cloud Spanner Queues Samples + +Python samples demonstrating sending immediate and scheduled messages to Cloud Spanner queues, streaming `RECEIVE_` rows, and acknowledging messages. + +## Setup + +1. Create and activate a Python 3.13+ virtual environment: + + ```sh + python3 -m venv env + source env/bin/activate + ``` + +2. Install dependencies: + + ```sh + pip install -r requirements.txt + ``` + +## Running Tests + +Run unit tests offline: + +```sh +pip install -r requirements-test.txt +pytest tests +``` diff --git a/spanner/queues/noxfile_config.py b/spanner/queues/noxfile_config.py new file mode 100644 index 0000000000..fe371aaf48 --- /dev/null +++ b/spanner/queues/noxfile_config.py @@ -0,0 +1,21 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TEST_CONFIG_OVERRIDE = { + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "enforce_type_hints": True, + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + "pip_version_override": None, + "envs": {}, +} diff --git a/spanner/queues/pyproject.toml b/spanner/queues/pyproject.toml new file mode 100644 index 0000000000..6d82b656be --- /dev/null +++ b/spanner/queues/pyproject.toml @@ -0,0 +1,30 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Local samples only. This package isn't published: install it from this +# directory with `pip install -e .`, never by name from PyPI. +[build-system] +requires = ["setuptools>=64"] +build-backend = "setuptools.build_meta" + +[project] +name = "spanner-queues-samples" +version = "0.0.0" +requires-python = ">=3.13" +dependencies = [ + "google-api-core==2.44.0", + "google-cloud-spanner==3.72.0", +] +# PyPI rejects uploads with this classifier. +classifiers = ["Private :: Do Not Upload"] diff --git a/spanner/queues/requirements-test.txt b/spanner/queues/requirements-test.txt new file mode 100644 index 0000000000..ac63bdc5a9 --- /dev/null +++ b/spanner/queues/requirements-test.txt @@ -0,0 +1,2 @@ +-e . +pytest==9.2.0 diff --git a/spanner/queues/requirements.txt b/spanner/queues/requirements.txt new file mode 100644 index 0000000000..a56c81cc2e --- /dev/null +++ b/spanner/queues/requirements.txt @@ -0,0 +1,2 @@ +google-api-core==2.44.0 +google-cloud-spanner==3.72.0 diff --git a/spanner/queues/src/spanner_queues/__init__.py b/spanner/queues/src/spanner_queues/__init__.py new file mode 100644 index 0000000000..58d482ea38 --- /dev/null +++ b/spanner/queues/src/spanner_queues/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/spanner/queues/src/spanner_queues/queue_send_message.py b/spanner/queues/src/spanner_queues/queue_send_message.py new file mode 100644 index 0000000000..d4002f26c9 --- /dev/null +++ b/spanner/queues/src/spanner_queues/queue_send_message.py @@ -0,0 +1,102 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START spanner_queue_send_message] +import base64 +from datetime import datetime, timezone +import sys +import uuid + +from google.api_core import exceptions +from google.cloud import spanner + + +def send_queue_message(project_id: str, instance_id: str, database_id: str) -> None: + """Sends a message to a Cloud Spanner queue using a Send mutation. + + Args: + project_id: The Google Cloud project ID. + instance_id: The Spanner instance ID. + database_id: The Spanner database ID containing Users and UserTasks. + """ + client = spanner.Client(project=project_id) + database = client.instance(instance_id).database(database_id) + queue_name = "UserTasks" + user_id = 1 + message_id = str(uuid.uuid4()) + # Python protobuf Value encodes BYTES payloads from base64-encoded strings. + encoded_payload = base64.b64encode(b"example-task-payload").decode("ascii") + deliver_time = datetime.now(timezone.utc) + + try: + with database.batch() as batch: + batch.send( + queue=queue_name, + key=[user_id, message_id], + payload=encoded_payload, + deliver_time=deliver_time, + ) + except exceptions.NotFound as err: + print( + f"error: queue '{queue_name}' or parent row on database " + f"'{database_id}' in instance '{instance_id}' for project " + f"'{project_id}' was not found: {err.message}", + file=sys.stderr, + ) + except exceptions.GoogleAPICallError as err: + print( + f"error: failed to send message to queue '{queue_name}' on " + f"database '{database_id}' in instance '{instance_id}' for project " + f"'{project_id}': {err.message}", + file=sys.stderr, + ) + else: + print(f"Resource ID: {database.name}") + print(f"Message ID: {message_id}") + print(f"Queue Name: {queue_name}") + print(f"User ID: {user_id}") + + +# [END spanner_queue_send_message] + + +if __name__ == "__main__": + import argparse + import os + + parser = argparse.ArgumentParser( + description="Send a message to a Cloud Spanner queue." + ) + parser.add_argument( + "--project-id", + default=os.environ.get("GOOGLE_CLOUD_PROJECT", "example-project-id"), + help="Google Cloud project ID (default: $GOOGLE_CLOUD_PROJECT)", + ) + parser.add_argument( + "--instance-id", + default=os.environ.get("SPANNER_INSTANCE_ID", "example-instance"), + help="Spanner instance ID (default: $SPANNER_INSTANCE_ID)", + ) + parser.add_argument( + "--database-id", + default=os.environ.get("SPANNER_DATABASE_ID", "example-db"), + help="Spanner database ID (default: $SPANNER_DATABASE_ID)", + ) + args = parser.parse_args() + + send_queue_message( + project_id=args.project_id, + instance_id=args.instance_id, + database_id=args.database_id, + ) diff --git a/spanner/queues/tests/__init__.py b/spanner/queues/tests/__init__.py new file mode 100644 index 0000000000..58d482ea38 --- /dev/null +++ b/spanner/queues/tests/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/spanner/queues/tests/conftest.py b/spanner/queues/tests/conftest.py new file mode 100644 index 0000000000..243b509aec --- /dev/null +++ b/spanner/queues/tests/conftest.py @@ -0,0 +1,38 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Shared live-test configuration for Cloud Spanner Queues Samples.""" + +import os + +import pytest + +LIVE_PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT", "") +LIVE_INSTANCE_ID = os.environ.get("SPANNER_INSTANCE_ID", "") +LIVE_DATABASE_ID = os.environ.get( + "SPANNER_DATABASE_ID", os.environ.get("SPANNER_DATABASE_ID", "") +) + +if os.environ.get("RUN_INTEGRATION_TESTS") == "true" and ( + not LIVE_PROJECT_ID or not LIVE_INSTANCE_ID or not LIVE_DATABASE_ID +): + raise RuntimeError( + "Set GOOGLE_CLOUD_PROJECT, SPANNER_INSTANCE_ID, and " + "SPANNER_DATABASE_ID when RUN_INTEGRATION_TESTS=true." + ) + +live_only = pytest.mark.skipif( + os.environ.get("RUN_INTEGRATION_TESTS") != "true", + reason="Set RUN_INTEGRATION_TESTS=true to run integration tests.", +) diff --git a/spanner/queues/tests/queue_send_message_test.py b/spanner/queues/tests/queue_send_message_test.py new file mode 100644 index 0000000000..fe8deae099 --- /dev/null +++ b/spanner/queues/tests/queue_send_message_test.py @@ -0,0 +1,123 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import runpy +from unittest import mock + +from google.api_core import exceptions +import pytest +from spanner_queues import queue_send_message + +from . import conftest + +PROJECT_ID = "example-project-id" +INSTANCE_ID = "example-instance" +DATABASE_ID = "example-db" +DATABASE_NAME = f"projects/{PROJECT_ID}/instances/{INSTANCE_ID}/databases/{DATABASE_ID}" +SPANNER_CLIENT = "google.cloud.spanner.Client" + + +@mock.patch(SPANNER_CLIENT) +def test_send_queue_message_success( + mock_client_class: mock.MagicMock, capsys: pytest.CaptureFixture[str] +) -> None: + database = ( + mock_client_class.return_value.instance.return_value.database.return_value + ) + database.name = DATABASE_NAME + batch = database.batch.return_value.__enter__.return_value + + queue_send_message.send_queue_message(PROJECT_ID, INSTANCE_ID, DATABASE_ID) + + batch.send.assert_called_once() + assert batch.send.call_args.kwargs["queue"] == "UserTasks" + out, err = capsys.readouterr() + assert f"Resource ID: {DATABASE_NAME}" in out + assert "Queue Name: UserTasks" in out + assert "User ID: 1" in out + assert err == "" + + +@pytest.mark.parametrize( + "error, expected_prefix", + [ + ( + exceptions.NotFound("missing queue"), + "error: queue 'UserTasks' or parent row", + ), + ( + exceptions.PermissionDenied("denied"), + "error: failed to send message to queue 'UserTasks'", + ), + ], +) +@mock.patch(SPANNER_CLIENT) +def test_send_queue_message_errors( + mock_client_class: mock.MagicMock, + capsys: pytest.CaptureFixture[str], + error: Exception, + expected_prefix: str, +) -> None: + database = ( + mock_client_class.return_value.instance.return_value.database.return_value + ) + database.batch.return_value.__enter__.side_effect = error + + queue_send_message.send_queue_message(PROJECT_ID, INSTANCE_ID, DATABASE_ID) + + out, err = capsys.readouterr() + assert out == "" + assert err.startswith(expected_prefix) + + +@mock.patch(SPANNER_CLIENT) +def test_send_queue_message_cli_entrypoint( + mock_client_class: mock.MagicMock, + monkeypatch: pytest.MonkeyPatch, + capsys: pytest.CaptureFixture[str], +) -> None: + database = ( + mock_client_class.return_value.instance.return_value.database.return_value + ) + database.name = DATABASE_NAME + monkeypatch.setattr( + "sys.argv", + [ + "queue_send_message.py", + "--project-id", + PROJECT_ID, + "--instance-id", + INSTANCE_ID, + "--database-id", + DATABASE_ID, + ], + ) + + runpy.run_module("spanner_queues.queue_send_message", run_name="__main__") + + assert "Queue Name: UserTasks" in capsys.readouterr().out + + +@conftest.live_only +def test_send_queue_message_live(capsys: pytest.CaptureFixture[str]) -> None: + queue_send_message.send_queue_message( + conftest.LIVE_PROJECT_ID, + conftest.LIVE_INSTANCE_ID, + conftest.LIVE_DATABASE_ID, + ) + + out, err = capsys.readouterr() + assert err == "" + assert "Queue Name: UserTasks" in out + assert "User ID: 1" in out From 16b631d1b8589cda94c341efbe759e68ff3ed487 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Wed, 18 Nov 2026 00:38:23 +0000 Subject: [PATCH 2/3] fix(spanner): Omit project_id from queue send sample output Avoids printing project identifiers in stdout or stderr and simplifies duplicate environment variable lookup in test configuration. --- .../queues/src/spanner_queues/queue_send_message.py | 10 +++++----- spanner/queues/tests/conftest.py | 4 +--- spanner/queues/tests/queue_send_message_test.py | 5 ++++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spanner/queues/src/spanner_queues/queue_send_message.py b/spanner/queues/src/spanner_queues/queue_send_message.py index d4002f26c9..cda53c67bd 100644 --- a/spanner/queues/src/spanner_queues/queue_send_message.py +++ b/spanner/queues/src/spanner_queues/queue_send_message.py @@ -50,19 +50,19 @@ def send_queue_message(project_id: str, instance_id: str, database_id: str) -> N except exceptions.NotFound as err: print( f"error: queue '{queue_name}' or parent row on database " - f"'{database_id}' in instance '{instance_id}' for project " - f"'{project_id}' was not found: {err.message}", + f"'{database_id}' in instance '{instance_id}'" + f" was not found: {err.message}", file=sys.stderr, ) except exceptions.GoogleAPICallError as err: print( f"error: failed to send message to queue '{queue_name}' on " - f"database '{database_id}' in instance '{instance_id}' for project " - f"'{project_id}': {err.message}", + f"database '{database_id}' in instance '{instance_id}'" + f": {err.message}", file=sys.stderr, ) else: - print(f"Resource ID: {database.name}") + print(f"Resource ID: {database_id}") print(f"Message ID: {message_id}") print(f"Queue Name: {queue_name}") print(f"User ID: {user_id}") diff --git a/spanner/queues/tests/conftest.py b/spanner/queues/tests/conftest.py index 243b509aec..eb01c59c97 100644 --- a/spanner/queues/tests/conftest.py +++ b/spanner/queues/tests/conftest.py @@ -20,9 +20,7 @@ LIVE_PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT", "") LIVE_INSTANCE_ID = os.environ.get("SPANNER_INSTANCE_ID", "") -LIVE_DATABASE_ID = os.environ.get( - "SPANNER_DATABASE_ID", os.environ.get("SPANNER_DATABASE_ID", "") -) +LIVE_DATABASE_ID = os.environ.get("SPANNER_DATABASE_ID", "") if os.environ.get("RUN_INTEGRATION_TESTS") == "true" and ( not LIVE_PROJECT_ID or not LIVE_INSTANCE_ID or not LIVE_DATABASE_ID diff --git a/spanner/queues/tests/queue_send_message_test.py b/spanner/queues/tests/queue_send_message_test.py index fe8deae099..53fd5dde88 100644 --- a/spanner/queues/tests/queue_send_message_test.py +++ b/spanner/queues/tests/queue_send_message_test.py @@ -43,7 +43,8 @@ def test_send_queue_message_success( batch.send.assert_called_once() assert batch.send.call_args.kwargs["queue"] == "UserTasks" out, err = capsys.readouterr() - assert f"Resource ID: {DATABASE_NAME}" in out + assert f"Resource ID: {DATABASE_ID}" in out + assert PROJECT_ID not in out assert "Queue Name: UserTasks" in out assert "User ID: 1" in out assert err == "" @@ -79,6 +80,8 @@ def test_send_queue_message_errors( out, err = capsys.readouterr() assert out == "" assert err.startswith(expected_prefix) + assert PROJECT_ID not in err + assert PROJECT_ID not in err @mock.patch(SPANNER_CLIENT) From 375e71dd0eb94817e2c0c8ebb166ea31b2e79270 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Fri, 4 Dec 2026 05:46:32 +0000 Subject: [PATCH 3/3] chore(spanner): apply review feedback to queue_send_message Problem: reviewers of this sample set asked for stricter and clearer tests and for a single source of truth for dependencies. Mocks were created without a spec, so a renamed client argument would pass silently; the mocked wait timeout was raised from the API call instead of from the operation's result; live tests did not say which environment variables they need; and some tests carried leftover or repeated lines. Package dependencies were pinned in both pyproject.toml and requirements.txt. Solution: where applicable to the files below, patch client classes with autospec=True, raise the mocked TimeoutError from operation.result(), document the required environment variables above each live test and skip when one is missing, remove unused or duplicated test lines, and join string literals that the formatter had left split on one line. For package scaffolding, read dependencies from requirements.txt and update the README install command to match. Files updated: - spanner/queues/README.md - spanner/queues/pyproject.toml - spanner/queues/tests/queue_send_message_test.py --- spanner/queues/README.md | 4 ++-- spanner/queues/pyproject.toml | 9 +++++---- spanner/queues/tests/queue_send_message_test.py | 15 +++++---------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/spanner/queues/README.md b/spanner/queues/README.md index cca8c44bad..bd019b165e 100644 --- a/spanner/queues/README.md +++ b/spanner/queues/README.md @@ -11,10 +11,10 @@ Python samples demonstrating sending immediate and scheduled messages to Cloud S source env/bin/activate ``` -2. Install dependencies: +2. Install the samples and their dependencies: ```sh - pip install -r requirements.txt + pip install -e . ``` ## Running Tests diff --git a/spanner/queues/pyproject.toml b/spanner/queues/pyproject.toml index 6d82b656be..c15138fe17 100644 --- a/spanner/queues/pyproject.toml +++ b/spanner/queues/pyproject.toml @@ -22,9 +22,10 @@ build-backend = "setuptools.build_meta" name = "spanner-queues-samples" version = "0.0.0" requires-python = ">=3.13" -dependencies = [ - "google-api-core==2.44.0", - "google-cloud-spanner==3.72.0", -] +# Dependencies are pinned in requirements.txt, the single source of truth. +dynamic = ["dependencies"] # PyPI rejects uploads with this classifier. classifiers = ["Private :: Do Not Upload"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} diff --git a/spanner/queues/tests/queue_send_message_test.py b/spanner/queues/tests/queue_send_message_test.py index 53fd5dde88..a8ba138c79 100644 --- a/spanner/queues/tests/queue_send_message_test.py +++ b/spanner/queues/tests/queue_send_message_test.py @@ -24,18 +24,16 @@ PROJECT_ID = "example-project-id" INSTANCE_ID = "example-instance" DATABASE_ID = "example-db" -DATABASE_NAME = f"projects/{PROJECT_ID}/instances/{INSTANCE_ID}/databases/{DATABASE_ID}" SPANNER_CLIENT = "google.cloud.spanner.Client" -@mock.patch(SPANNER_CLIENT) +@mock.patch(SPANNER_CLIENT, autospec=True) def test_send_queue_message_success( mock_client_class: mock.MagicMock, capsys: pytest.CaptureFixture[str] ) -> None: database = ( mock_client_class.return_value.instance.return_value.database.return_value ) - database.name = DATABASE_NAME batch = database.batch.return_value.__enter__.return_value queue_send_message.send_queue_message(PROJECT_ID, INSTANCE_ID, DATABASE_ID) @@ -63,7 +61,7 @@ def test_send_queue_message_success( ), ], ) -@mock.patch(SPANNER_CLIENT) +@mock.patch(SPANNER_CLIENT, autospec=True) def test_send_queue_message_errors( mock_client_class: mock.MagicMock, capsys: pytest.CaptureFixture[str], @@ -81,19 +79,14 @@ def test_send_queue_message_errors( assert out == "" assert err.startswith(expected_prefix) assert PROJECT_ID not in err - assert PROJECT_ID not in err -@mock.patch(SPANNER_CLIENT) +@mock.patch(SPANNER_CLIENT, autospec=True) def test_send_queue_message_cli_entrypoint( mock_client_class: mock.MagicMock, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], ) -> None: - database = ( - mock_client_class.return_value.instance.return_value.database.return_value - ) - database.name = DATABASE_NAME monkeypatch.setattr( "sys.argv", [ @@ -112,6 +105,8 @@ def test_send_queue_message_cli_entrypoint( assert "Queue Name: UserTasks" in capsys.readouterr().out +# Live integration test: skipped unless RUN_INTEGRATION_TESTS=true is set along with +# GOOGLE_CLOUD_PROJECT, SPANNER_INSTANCE_ID, and SPANNER_DATABASE_ID. @conftest.live_only def test_send_queue_message_live(capsys: pytest.CaptureFixture[str]) -> None: queue_send_message.send_queue_message(