1+ import asyncio
12from datetime import datetime , timedelta
3+
24from httpx import Response
35import pytest
4- import asyncio
56
6- from tests .common import get_response_json
77from xbox .webapi .api .provider .ratelimitedprovider import RateLimitedProvider
8-
98from xbox .webapi .common .exceptions import RateLimitExceededException , XboxException
109from xbox .webapi .common .ratelimits import CombinedRateLimit
1110from xbox .webapi .common .ratelimits .models import TimePeriod
1211
12+ from tests .common import get_response_json
13+
1314
1415def helper_test_combinedratelimit (
1516 crl : CombinedRateLimit , burstLimit : int , sustainLimit : int
@@ -18,8 +19,8 @@ def helper_test_combinedratelimit(
1819 sustain = crl .get_limits_by_period (TimePeriod .SUSTAIN )
1920
2021 # These functions should return a list with one element
21- assert type (burst ) == list
22- assert type (sustain ) == list
22+ assert isinstance (burst , list )
23+ assert isinstance (sustain , list )
2324
2425 assert len (burst ) == 1
2526 assert len (sustain ) == 1
@@ -111,7 +112,7 @@ async def make_request():
111112 route = respx_mock .get ("https://social.xboxlive.com" ).mock (
112113 return_value = Response (200 , json = get_response_json ("people_summary_own" ))
113114 )
114- ret = await xbl_client .people .get_friends_summary_own ()
115+ await xbl_client .people .get_friends_summary_own ()
115116
116117 assert route .called
117118
@@ -145,7 +146,7 @@ async def helper_reach_and_wait_for_burst(
145146 make_request , start_time , burst_limit : int , expected_counter : int
146147):
147148 # Make as many requests as possible without exceeding the BURST limit.
148- for i in range (burst_limit ):
149+ for _ in range (burst_limit ):
149150 await make_request ()
150151
151152 # Make another request, ensure that it raises the exception.
@@ -175,7 +176,7 @@ async def make_request():
175176 route = respx_mock .get ("https://social.xboxlive.com" ).mock (
176177 return_value = Response (200 , json = get_response_json ("people_summary_own" ))
177178 )
178- ret = await xbl_client .people .get_friends_summary_own ()
179+ await xbl_client .people .get_friends_summary_own ()
179180
180181 assert route .called
181182
@@ -201,7 +202,7 @@ async def make_request():
201202 )
202203
203204 # Now, make the rest of the requests (10 left, 20/30 done!)
204- for i in range (10 ):
205+ for _ in range (10 ):
205206 await make_request ()
206207
207208 # Wait for the burst limit to 'reset'.
0 commit comments