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

Commit 2789dc0

Browse files
committed
Disabled test_metrics for 3.7 due to OTEL semconv imports
1 parent 2dd3a0e commit 2789dc0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ protobuf==3.20.2
1717
deprecated==1.2.14
1818
grpc-interceptor==0.15.4
1919
google-cloud-monitoring==2.16.0
20+
mmh3==4.1.0

tests/unit/test_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
1516
from unittest.mock import MagicMock
1617
from google.api_core.exceptions import ServiceUnavailable
1718
from google.cloud.spanner_v1.client import Client
@@ -21,6 +22,9 @@
2122
SpannerMetricsTracerFactory,
2223
)
2324

25+
pytest.importorskip("opentelemetry")
26+
# Skip if semconv attributes are not present, as tracing wont' be enabled either
27+
pytest.importorskip("opentelemetry.semconv.attributes.otel_attributes")
2428

2529
def test_metrics_emission_with_failure_attempt(monkeypatch):
2630
monkeypatch.setenv("SPANNER_ENABLE_BUILTIN_METRICS", "true")

0 commit comments

Comments
 (0)