Closed vasqued2 closed 1 year ago
This was a change from homeassistant core. A lot of built in tests had to be updated due to this change. I suggest you look there for fixes.
Great. Thanks!
@vasqued2 I have the same issue, if you find a solution please share back.
@marcolivierarsenault
For now I hacked expected_lingering_timers
to ignore it. Lmk if you find a true fix.
@pytest.fixture(autouse=True)
def expected_lingering_timers() -> bool:
"""Temporary ability to bypass test failures.
Parametrize to True to bypass the pytest failure.
@pytest.mark.parametrize("expected_lingering_timers", [True])
This should be removed when all lingering timers have been cleaned up.
"""
return True
@pytest.mark.usefixtures("expected_lingering_timers")
async def test_sensor(hass, mocker):
""" Make sure sensor gets added """
entry = MockConfigEntry(
domain=DOMAIN,
title="NFL",
data=CONFIG_DATA,
)
mocker.patch("locale.getlocale", return_value=("en", 0))
# contents = "{}"
# mocker.patch('aiofiles.open', return_value=mocker.mock_open(read_data=contents).return_value)
entry.add_to_hass(hass)
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert "teamtracker" in hass.config.components
@vasqued2 Try to add the following at the end of your test_sensor
function:
assert await entry.async_unload(hass)
await hass.async_block_till_done()
@Shulyaka Thanks! That resolved it.
My nightly build has started failing and it appears related to the
Remove asyncio-legacy
pull request. My last successful run was on 5/30.Any suggestions appreciated.
Thanks!
Here is an extract of some of the error log...
Link to the full log https://github.com/vasqued2/ha-teamtracker/actions/runs/4591896864/jobs/8108458747