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
2 changes: 2 additions & 0 deletions CHANGES/11363.packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The `blockbuster` test dependency is now optional; the corresponding test fixture is disabled when it is unavailable
-- by :user:`musicinybrain`.
10 changes: 8 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
from uuid import uuid4

import pytest
from blockbuster import blockbuster_ctx

try:
from blockbuster import blockbuster_ctx

HAS_BLOCKBUSTER = True
except ImportError: # For downstreams only # pragma: no cover
HAS_BLOCKBUSTER = False

from aiohttp import payload
from aiohttp.client_proto import ResponseHandler
Expand Down Expand Up @@ -46,7 +52,7 @@
IS_LINUX = sys.platform.startswith("linux")


@pytest.fixture(autouse=True)
@pytest.fixture(autouse=HAS_BLOCKBUSTER)
def blockbuster(request: pytest.FixtureRequest) -> Iterator[None]:
# Allow selectively disabling blockbuster for specific tests
# using the @pytest.mark.skip_blockbuster marker.
Expand Down
Loading