diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17b5d2a..4adf486 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,10 +26,10 @@ jobs: - '3.10' - '3.9' services: - nginx: - image: kennethreitz/httpbin + httpbin: + image: mccutchen/go-httpbin ports: - - 8080:80 + - 8080:8080 steps: # Install dependencies, with caching diff --git a/docker-compose.yml b/docker-compose.yml index b059093..41fbebb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,10 @@ # Containers needed to test all backend services locally services: httpbin: - image: kennethreitz/httpbin + image: mccutchen/go-httpbin container_name: httpbin ports: - # Use an unprivileged port to support running the Docker daemon as a non-root user (Rootless mode). - # See https://docs.docker.com/engine/security/rootless/#networking-errors - - ${HTTPBIN_CUSTOM_PORT:-8080}:80 + - ${HTTPBIN_CUSTOM_PORT:-8080}:8080 httpbin-custom: container_name: httpbin-custom diff --git a/test/conftest.py b/test/conftest.py index 0bb96ee..65ed38c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -13,7 +13,6 @@ CACHE_NAME = 'pytest_cache' HTTPBIN_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'] HTTPBIN_FORMATS = [ - 'brotli', 'deflate', 'deny', 'encoding/utf8', diff --git a/test/integration/base_backend_test.py b/test/integration/base_backend_test.py index c5aeb38..58cf226 100644 --- a/test/integration/base_backend_test.py +++ b/test/integration/base_backend_test.py @@ -291,7 +291,7 @@ async def test_cookies_with_redirect(self): session.cookie_jar.clear() await session.get(httpbin('cookies/set?test_cookie=value')) - cookies = session.cookie_jar.filter_cookies(httpbin()) + cookies = session.cookie_jar.filter_cookies(httpbin('cookies')) assert cookies['test_cookie'].value == 'value' async def test_autoclose(self): diff --git a/test/unit/test_session.py b/test/unit/test_session.py index a258184..3a5c345 100644 --- a/test/unit/test_session.py +++ b/test/unit/test_session.py @@ -3,6 +3,7 @@ from http.cookies import SimpleCookie from unittest.mock import AsyncMock, MagicMock, patch +import aiohttp import pytest from aiohttp import ClientResponse from yarl import URL @@ -13,7 +14,8 @@ pytestmark = [pytest.mark.asyncio] - +aiohttp_314 = tuple(int(x) for x in aiohttp.__version__.split('.')[:2]) >= (3, 14) +extra_args = {'stream_writer': MagicMock()} if aiohttp_314 else {} FakeCachedResponse = CachedResponse(method='GET', reason='OK', status=200, url='url', version='1.1') FakeClientResponse = ClientResponse( method='GET', @@ -26,6 +28,7 @@ # loop=asyncio.get_event_loop(), loop=MagicMock(), session=None, # type: ignore[arg-type] + **extra_args, # type: ignore[arg-type] )