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

Drop async_add_import_executor_job #55

Merged
merged 2 commits into from
Jun 20, 2024
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
24 changes: 0 additions & 24 deletions tests/test_async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,30 +563,6 @@ async def test_task():
assert result.result() == "Foo"


@pytest.mark.parametrize("eager_start", [True, False])
async def test_cancellable_ZHAJob(zha_gateway: Gateway, eager_start: bool) -> None:
"""Simulate a shutdown, ensure cancellable jobs are cancelled."""
job = MagicMock()

@callback
def run_job(job: ZHAJob) -> None:
"""Call the action."""
zha_gateway.async_run_hass_job(job, eager_start=eager_start)

timer1 = zha_gateway.loop.call_later(
60, run_job, ZHAJob(callback(job), cancel_on_shutdown=True)
)
timer2 = zha_gateway.loop.call_later(60, run_job, ZHAJob(callback(job)))

await zha_gateway.shutdown()

assert timer1.cancelled()
assert not timer2.cancelled()

# Cleanup
timer2.cancel()


def test_ZHAJob_passing_job_type():
"""Test passing the job type to ZHAJob when we already know it."""

Expand Down
94 changes: 0 additions & 94 deletions tests/test_executor.py

This file was deleted.

111 changes: 0 additions & 111 deletions tests/test_thread.py

This file was deleted.

2 changes: 1 addition & 1 deletion zha/application/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def async_initialize(self) -> None:
discovery.GROUP_PROBE.initialize(self)

if self.config.config.quirks_configuration.enabled:
await self.async_add_import_executor_job(
await self.async_add_executor_job(
setup_quirks, self.config.config.quirks_configuration.custom_quirks_path
)

Expand Down
Loading
Loading