20
20
from yarl import URL
21
21
22
22
import aiohttp
23
- from aiohttp import Fingerprint , ServerFingerprintMismatch , client_reqrep , hdrs , web
23
+ from aiohttp import Fingerprint , ServerFingerprintMismatch , hdrs , web
24
24
from aiohttp .abc import AbstractResolver
25
25
from aiohttp .client_exceptions import (
26
26
ClientResponseError ,
@@ -676,10 +676,7 @@ async def handler(request):
676
676
assert 200 == resp .status
677
677
678
678
679
- @pytest .mark .parametrize ("yarl_supports_extend_query" , [True , False ])
680
- async def test_params_and_query_string (
681
- aiohttp_client : AiohttpClient , yarl_supports_extend_query : bool
682
- ) -> None :
679
+ async def test_params_and_query_string (aiohttp_client : AiohttpClient ) -> None :
683
680
"""Test combining params with an existing query_string."""
684
681
685
682
async def handler (request : web .Request ) -> web .Response :
@@ -690,18 +687,13 @@ async def handler(request: web.Request) -> web.Response:
690
687
app .router .add_route ("GET" , "/" , handler )
691
688
client = await aiohttp_client (app )
692
689
693
- # Ensure the old path is tested for old yarl versions
694
- with mock .patch .object (
695
- client_reqrep , "_YARL_SUPPORTS_EXTEND_QUERY" , yarl_supports_extend_query
696
- ):
697
- async with client .get ("/?q=abc" , params = "q=test&d=dog" ) as resp :
698
- assert resp .status == 200
690
+ async with client .get ("/?q=abc" , params = "q=test&d=dog" ) as resp :
691
+ assert resp .status == 200
699
692
700
693
701
694
@pytest .mark .parametrize ("params" , [None , "" , {}, MultiDict ()])
702
- @pytest .mark .parametrize ("yarl_supports_extend_query" , [True , False ])
703
695
async def test_empty_params_and_query_string (
704
- aiohttp_client : AiohttpClient , params : Any , yarl_supports_extend_query : bool
696
+ aiohttp_client : AiohttpClient , params : Any
705
697
) -> None :
706
698
"""Test combining empty params with an existing query_string."""
707
699
@@ -713,12 +705,8 @@ async def handler(request: web.Request) -> web.Response:
713
705
app .router .add_route ("GET" , "/" , handler )
714
706
client = await aiohttp_client (app )
715
707
716
- # Ensure the old path is tested for old yarl versions
717
- with mock .patch .object (
718
- client_reqrep , "_YARL_SUPPORTS_EXTEND_QUERY" , yarl_supports_extend_query
719
- ):
720
- async with client .get ("/?q=abc" , params = params ) as resp :
721
- assert resp .status == 200
708
+ async with client .get ("/?q=abc" , params = params ) as resp :
709
+ assert resp .status == 200
722
710
723
711
724
712
async def test_drop_params_on_redirect (aiohttp_client : AiohttpClient ) -> None :
0 commit comments