Skip to content

Commit

Permalink
Revert a vestige of mock
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Nov 13, 2024
1 parent e386f3e commit 5cddcbe
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/unit/test__opentelemetry_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ def _make_rpc_error(error_cls, trailing_metadata=None):
def _make_session():
from google.cloud.spanner_v1.session import Session

session = mock.Mock(autospec=Session, instance=True)
# Setting _observability_options to None is to avoid the nasty spill-over
# of mock._tracer_provider spuriously failing tests, because per
# unittest.mock.Mock's definition invoking any attribute or method
# returns another mock.
db = session._database
setattr(db, "observability_options", None)
return session
return mock.Mock(autospec=Session, instance=True)


# Skip all of these tests if we don't have OpenTelemetry
Expand Down

0 comments on commit 5cddcbe

Please sign in to comment.