Skip to content

Commit 97cd97e

Browse files
committed
chore(api-core): remove obsolete samples and fix pytest skip logic
Removed Translate samples as we are shifting focus to Secret Manager and avoiding auto-instrumentation. Fixed a TypeError in pytest.skip usage in test_tracing.py.
1 parent 1a59011 commit 97cd97e

3 files changed

Lines changed: 7 additions & 98 deletions

File tree

packages/google-api-core/samples/sample_auto_translate_trace.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/google-api-core/samples/sample_translate_trace.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/google-api-core/tests/unit/observability/test_tracing.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818

1919
import pytest
2020

21+
has_deps = True
2122
try:
2223
import grpc # noqa: F401
23-
from opentelemetry import trace
24+
from opentelemetry import trace # noqa: F401
2425
except ImportError:
25-
# TODO: add variables to highlight which dependency failed.
26-
pytest.skip(
27-
"Skipping gRPC/OTel tests because dependencies are missing", allow_hide_cpp=True
28-
)
26+
has_deps = False
27+
28+
pytestmark = pytest.mark.skipif(
29+
not has_deps, reason="Skipping gRPC/OTel tests because dependencies are missing"
30+
)
2931

3032

3133
class MockClientCallDetails:

0 commit comments

Comments
 (0)