Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/9705.contrib.rst
Original file line number Diff line number Diff line change
@@ -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`.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ Robert Lu
Robert Nikolich
Roman Markeloff
Roman Podoliaka
Roman Postnov
Rong Zhang
Samir Akarioh
Samuel Colvin
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_web_sendfile_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Loading