File tree Expand file tree Collapse file tree
packages/google-cloud-bigtable/tests/unit/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,15 @@ def set_event_loop():
9393 asyncio .set_event_loop (None )
9494
9595
96+ @pytest .fixture (autouse = True )
97+ def mock_metrics_batch_write ():
98+ """mock out the metrics batch write to avoid sending metrics to GCP during tests."""
99+ with mock .patch (
100+ "google.cloud.bigtable.data._metrics.handlers.gcp_exporter.BigtableMetricsExporter._batch_write"
101+ ):
102+ yield
103+
104+
96105@CrossSync .convert_class (
97106 sync_name = "TestBigtableDataClient" ,
98107 add_mapping_for_name = "TestBigtableDataClient" ,
Original file line number Diff line number Diff line change @@ -73,6 +73,15 @@ def set_event_loop():
7373 asyncio .set_event_loop (None )
7474
7575
76+ @pytest .fixture (autouse = True )
77+ def mock_metrics_batch_write ():
78+ """mock out the metrics batch write to avoid sending metrics to GCP during tests."""
79+ with mock .patch (
80+ "google.cloud.bigtable.data._metrics.handlers.gcp_exporter.BigtableMetricsExporter._batch_write"
81+ ):
82+ yield
83+
84+
7685@CrossSync ._Sync_Impl .add_mapping_decorator ("TestBigtableDataClient" )
7786class TestBigtableDataClient :
7887 @staticmethod
You can’t perform that action at this time.
0 commit comments