diff --git a/CHANGES/9705.contrib.rst b/CHANGES/9705.contrib.rst new file mode 100644 index 00000000000..771fb442629 --- /dev/null +++ b/CHANGES/9705.contrib.rst @@ -0,0 +1 @@ +Speed up tests by disabling ``blockbuster`` fixture for ``test_static_file_huge`` and ``test_static_file_huge_cancel`` tests -- by :user:`dikos1337`. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e3ddd3e3d6a..0866da52633 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -305,6 +305,7 @@ Robert Lu Robert Nikolich Roman Markeloff Roman Podoliaka +Roman Postnov Rong Zhang Samir Akarioh Samuel Colvin diff --git a/setup.cfg b/setup.cfg index 674d9ed7c44..c3c6e0270a1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -180,3 +180,4 @@ xfail_strict = true markers = dev_mode: mark test to run in dev mode. internal: tests which may cause issues for packagers, but should be run in aiohttp's CI. + skip_blockbuster: mark test to skip the blockbuster fixture. diff --git a/tests/conftest.py b/tests/conftest.py index e8e11835393..6ede2ba59fb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,6 +40,12 @@ @pytest.fixture(autouse=True) def blockbuster(request: pytest.FixtureRequest) -> Iterator[None]: + # Allow selectively disabling blockbuster for specific tests + # using the @pytest.mark.skip_blockbuster marker. + if "skip_blockbuster" in request.node.keywords: + yield + return + # No blockbuster for benchmark tests. node = request.node.parent while node: diff --git a/tests/test_web_sendfile_functional.py b/tests/test_web_sendfile_functional.py index 64b97787616..eaef4930d09 100644 --- a/tests/test_web_sendfile_functional.py +++ b/tests/test_web_sendfile_functional.py @@ -656,6 +656,7 @@ async def test_static_file_directory_traversal_attack( await client.close() +@pytest.mark.skip_blockbuster async def test_static_file_huge( aiohttp_client: AiohttpClient, tmp_path: pathlib.Path ) -> None: @@ -1091,6 +1092,7 @@ async def handler(request: web.Request) -> web.FileResponse: await client.close() +@pytest.mark.skip_blockbuster async def test_static_file_huge_cancel( aiohttp_client: AiohttpClient, tmp_path: pathlib.Path ) -> None: