def get_cookie_jar(self) -> aiohttp.CookieJar: loop = get_running_loop() jar = aiohttp.CookieJar(loop=loop, unsafe=True, quote_cookie=self._quote_cookies) cookies: Optional[Dict] = self.get_cookies() if cookies is not None: jar.update_cookies(cookies) return jar
async def test_get_running_loop_ok(loop) -> None: assert helpers.get_running_loop() is loop
def test_get_running_loop_not_running(loop) -> None: with pytest.raises( RuntimeError, match="The object should be created within an async function"): helpers.get_running_loop()
def test_get_running_loop_not_running(loop) -> None: with pytest.warns(DeprecationWarning): helpers.get_running_loop()
def test_get_running_loop_not_running(loop) -> None: with pytest.raises( RuntimeError, match="The object should be created from async function"): helpers.get_running_loop()