Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable expensive pskc computation in all otbr tests #124292

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Disable expensive pskc computation in all otbr tests
  • Loading branch information
emontnemery committed Aug 20, 2024
commit 89954fb735503aaed9ec1aa91b05cbaa990199f7
17 changes: 17 additions & 0 deletions tests/components/otbr/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@
from tests.common import MockConfigEntry


@pytest.fixture(name="enable_compute_pskc")
def enable_compute_pskc_fixture() -> Any:
"""Allow controlling if compute_pskc should be enabled."""
return False


@pytest.fixture(name="compute_pskc", autouse=True)
def compute_pskc_fixture(enable_compute_pskc: bool) -> Any:
"""Patch homeassistant.components.otbr.util.compute_pskc."""
compute_pskc = otbr.util.compute_pskc if enable_compute_pskc else None

with patch(
"homeassistant.components.otbr.util.compute_pskc", side_effect=compute_pskc
) as compute_pskc_mock:
yield compute_pskc_mock


@pytest.fixture(name="dataset")
def dataset_fixture() -> Any:
"""Return the discovery info from the supervisor."""
Expand Down
1 change: 1 addition & 0 deletions tests/components/otbr/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ async def test_import_share_radio_no_channel_collision(
)


@pytest.mark.parametrize("enable_compute_pskc", [True])
@pytest.mark.parametrize(
"dataset", [DATASET_INSECURE_NW_KEY, DATASET_INSECURE_PASSPHRASE]
)
Expand Down
Loading