2727 MarketLocationRef ,
2828 MarketLocationSample ,
2929 MarketLocationSeries ,
30- MarketLocationUpdate ,
3130 MarketLocationsFilter ,
31+ MarketLocationUpdate ,
3232 MetricType ,
3333 MetricUnit ,
3434 PaginationParams ,
@@ -46,8 +46,10 @@ def _make_client() -> MarketMeteringApiClient:
4646 connect = False ,
4747 )
4848 # Inject a mock stub so we don't need a real connection.
49+ # pylint: disable=protected-access
4950 client ._stub = MagicMock () # noqa: SLF001
5051 client ._channel = MagicMock () # noqa: SLF001
52+ # pylint: enable=protected-access
5153 return client
5254
5355
@@ -449,9 +451,9 @@ async def test_yields_parsed_series(self) -> None:
449451 response = pb .ReceiveMarketLocationSamplesStreamResponse (series = [series_pb ])
450452
451453 # Mock the streaming call to return an async iterator.
452- async def mock_stream () -> AsyncIterator [
453- pb .ReceiveMarketLocationSamplesStreamResponse
454- ] :
454+ async def mock_stream () -> (
455+ AsyncIterator [ pb .ReceiveMarketLocationSamplesStreamResponse ]
456+ ) :
455457 yield response
456458
457459 client .stub .ReceiveMarketLocationSamplesStream = MagicMock (
@@ -477,9 +479,9 @@ async def test_sends_time_filter(self) -> None:
477479 """Test that start_time and end_time are sent."""
478480 client = _make_client ()
479481
480- async def mock_stream () -> AsyncIterator [
481- pb .ReceiveMarketLocationSamplesStreamResponse
482- ] :
482+ async def mock_stream () -> (
483+ AsyncIterator [ pb .ReceiveMarketLocationSamplesStreamResponse ]
484+ ) :
483485 return
484486 yield # make it an async generator # noqa: RET504
485487
@@ -534,9 +536,9 @@ async def test_yields_parsed_results(self) -> None:
534536 error_code = pb .SAMPLE_UPSERT_ERROR_CODE_UNSPECIFIED ,
535537 )
536538
537- async def mock_stream () -> AsyncIterator [
538- pb .UpsertMarketLocationSamplesStreamResponse
539- ] :
539+ async def mock_stream () -> (
540+ AsyncIterator [ pb .UpsertMarketLocationSamplesStreamResponse ]
541+ ) :
540542 yield upsert_response
541543
542544 client .stub .UpsertMarketLocationSamplesStream = MagicMock (
@@ -562,9 +564,9 @@ async def mock_stream() -> AsyncIterator[
562564 samples = [sample ],
563565 )
564566
565- async def input_stream () -> AsyncIterator [
566- tuple [MarketLocationRef , MarketLocationSeries ]
567- ] :
567+ async def input_stream () -> (
568+ AsyncIterator [ tuple [MarketLocationRef , MarketLocationSeries ] ]
569+ ) :
568570 yield (ml_ref , series )
569571
570572 results = []
0 commit comments