Fail CI on lingering tasks (#88905)

This commit is contained in:
epenet 2023-03-07 11:35:48 +01:00 committed by GitHub
parent 85bcf11aeb
commit c51bde9a26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 170 additions and 2 deletions

View file

@ -3,6 +3,7 @@
import json
from aiogithubapi import GitHubException
import pytest
from homeassistant.components.github.const import CONF_REPOSITORIES, DOMAIN
from homeassistant.core import HomeAssistant
@ -15,6 +16,8 @@ from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import ClientSessionGenerator
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_entry_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
@ -54,6 +57,8 @@ async def test_entry_diagnostics(
)
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_entry_diagnostics_exception(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,

View file

@ -11,6 +11,8 @@ from tests.common import MockConfigEntry
from tests.test_util.aiohttp import AiohttpClientMocker
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_device_registry_cleanup(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
@ -46,6 +48,8 @@ async def test_device_registry_cleanup(
assert len(devices) == 0
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_subscription_setup(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
@ -61,6 +65,8 @@ async def test_subscription_setup(
)
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_subscription_setup_polling_disabled(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,

View file

@ -1,6 +1,8 @@
"""Test GitHub sensor."""
import json
import pytest
from homeassistant.components.github.const import DOMAIN, FALLBACK_UPDATE_INTERVAL
from homeassistant.core import HomeAssistant
from homeassistant.util import dt
@ -13,6 +15,8 @@ from tests.test_util.aiohttp import AiohttpClientMocker
TEST_SENSOR_ENTITY = "sensor.octocat_hello_world_latest_release"
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_sensor_updates_with_empty_release_array(
hass: HomeAssistant,
init_integration: MockConfigEntry,