Speed up ZHA initialization and improve startup responsiveness (#108103)
* Limit concurrency of startup traffic to allow for interactive usage * Drop `retryable_req`, we already have request retrying * Oops, `min` -> `max` * Add a comment describing why `async_initialize` is not concurrent * Fix existing unit tests * Break out fetching mains state into its own function to unit test
This commit is contained in:
parent
3ae858e3bf
commit
867caab70a
7 changed files with 151 additions and 84 deletions
|
@ -135,7 +135,7 @@ def _wrap_mock_instance(obj: Any) -> MagicMock:
|
|||
real_attr = getattr(obj, attr_name)
|
||||
mock_attr = getattr(mock, attr_name)
|
||||
|
||||
if callable(real_attr):
|
||||
if callable(real_attr) and not hasattr(real_attr, "__aenter__"):
|
||||
mock_attr.side_effect = real_attr
|
||||
else:
|
||||
setattr(mock, attr_name, real_attr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue