@@ -22,13 +22,13 @@ def __init__(self):
2222 self ._client_info : OAuthClientInformationFull | None = None
2323
2424 async def get_tokens (self ) -> OAuthToken | None :
25- return self ._tokens
25+ return self ._tokens # pragma: no cover
2626
2727 async def set_tokens (self , tokens : OAuthToken ) -> None :
2828 self ._tokens = tokens
2929
3030 async def get_client_info (self ) -> OAuthClientInformationFull | None :
31- return self ._client_info
31+ return self ._client_info # pragma: no cover
3232
3333 async def set_client_info (self , client_info : OAuthClientInformationFull ) -> None :
3434 self ._client_info = client_info
@@ -64,11 +64,11 @@ def valid_tokens():
6464def oauth_provider (client_metadata : OAuthClientMetadata , mock_storage : MockTokenStorage ):
6565 async def redirect_handler (url : str ) -> None :
6666 """Mock redirect handler."""
67- pass
67+ pass # pragma: no cover
6868
6969 async def callback_handler () -> tuple [str , str | None ]:
7070 """Mock callback handler."""
71- return "test_auth_code" , "test_state"
71+ return "test_auth_code" , "test_state" # pragma: no cover
7272
7373 return OAuthClientProvider (
7474 server_url = "https://api.example.com/v1/mcp" ,
@@ -247,10 +247,10 @@ async def test_discover_protected_resource_request(
247247 """Test protected resource discovery request building maintains backward compatibility."""
248248
249249 async def redirect_handler (url : str ) -> None :
250- pass
250+ pass # pragma: no cover
251251
252252 async def callback_handler () -> tuple [str , str | None ]:
253- return "test_auth_code" , "test_state"
253+ return "test_auth_code" , "test_state" # pragma: no cover
254254
255255 provider = OAuthClientProvider (
256256 server_url = "https://api.example.com" ,
@@ -664,7 +664,7 @@ async def aread(self):
664664
665665 @property
666666 def text (self ):
667- if not self ._aread_called :
667+ if not self ._aread_called : # pragma: no cover
668668 raise RuntimeError ("Response.text accessed before response.aread()" )
669669 return self ._text
670670
@@ -847,10 +847,10 @@ async def test_auth_flow_no_unnecessary_retry_after_oauth(
847847 # In the buggy version, this would yield the request AGAIN unconditionally
848848 # In the fixed version, this should end the generator
849849 try :
850- await auth_flow .asend (response ) # extra request
851- request_yields += 1
852- # If we reach here, the bug is present
853- pytest .fail (
850+ await auth_flow .asend (response ) # extra request # pragma: no cover
851+ request_yields += 1 # pragma: no cover
852+ # If we reach here, the bug is present # pragma: no cover
853+ pytest .fail ( # pragma: no cover
854854 f"Unnecessary retry detected! Request was yielded { request_yields } times. "
855855 f"This indicates the retry logic bug that caused 2x performance degradation. "
856856 f"The request should only be yielded once for successful responses."
@@ -950,7 +950,7 @@ async def mock_callback() -> tuple[str, str | None]:
950950 success_response = httpx .Response (200 , request = final_request )
951951 try :
952952 await auth_flow .asend (success_response )
953- pytest .fail ("Should have stopped after successful response" )
953+ pytest .fail ("Should have stopped after successful response" ) # pragma: no cover
954954 except StopAsyncIteration :
955955 pass # Expected
956956
@@ -1094,10 +1094,10 @@ def test_extract_field_from_www_auth_valid_cases(
10941094 """Test extraction of various fields from valid WWW-Authenticate headers."""
10951095
10961096 async def redirect_handler (url : str ) -> None :
1097- pass
1097+ pass # pragma: no cover
10981098
10991099 async def callback_handler () -> tuple [str , str | None ]:
1100- return "test_auth_code" , "test_state"
1100+ return "test_auth_code" , "test_state" # pragma: no cover
11011101
11021102 provider = OAuthClientProvider (
11031103 server_url = "https://api.example.com/v1/mcp" ,
@@ -1142,10 +1142,10 @@ def test_extract_field_from_www_auth_invalid_cases(
11421142 """Test extraction returns None for invalid cases."""
11431143
11441144 async def redirect_handler (url : str ) -> None :
1145- pass
1145+ pass # pragma: no cover
11461146
11471147 async def callback_handler () -> tuple [str , str | None ]:
1148- return "test_auth_code" , "test_state"
1148+ return "test_auth_code" , "test_state" # pragma: no cover
11491149
11501150 provider = OAuthClientProvider (
11511151 server_url = "https://api.example.com/v1/mcp" ,
0 commit comments