#PyTest Failures
1 messages ยท Page 1 of 1 (latest)
I have issues with my test setup and cannot run them locally. When pushing to the PR, PR checks fail with
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
E KeyError: 'entry_id'
PyTest Failures
Left a comment ๐
I basically c&p'ed the test from other integrations that do reauth flows. Hope that makes sense at all.
Next issue ๐ฆ
File "/home/runner/work/core/core/homeassistant/components/vicare/__init__.py", line 108, in async_unload_entry
hass.data[DOMAIN].pop(entry.entry_id)
~~~~~~~~~^^^^^^^^
KeyError: 'vicare'
Seems my test setup is not correct. In my system the feature works as expected.
Try this, didn't saw that the MockConfigEntry already generates a entry_id
L101++
config = MockConfigEntry(
domain=DOMAIN,
data=VALID_CONFIG,
)
config.add_to_hass(hass)
and
context={"source": SOURCE_REAUTH, "entry_id": config.entry_id},
Tests states "unknown flow"..
Yes, same for me locally. I think you don't need those lanes I mentioned in my comment