mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-12 19:56:29 +00:00
Address pytest warnings (#3347)
* Avoid accessing properties of udevice.parent The if statement currently causes access of a property of udevice.parent, leading to: tests/hardware/test_module.py: 104 warnings /workspaces/supervisor/supervisor/hardware/data.py:50: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties. Change the if statement to avoid property access and the deprecation warning. * Create task before using asyncio.wait() Avoid deprecation warnings such as: tests/store/test_custom_repository.py: 5 warnings /workspaces/supervisor/supervisor/store/__init__.py:113: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11. await asyncio.wait(tasks)
This commit is contained in:
parent
050851a9ac
commit
cde45e2e7a
@ -47,7 +47,7 @@ class Device:
|
||||
Path(udevice.device_node),
|
||||
Path(udevice.sys_path),
|
||||
udevice.subsystem,
|
||||
None if not udevice.parent else Path(udevice.parent.sys_path),
|
||||
None if udevice.parent is None else Path(udevice.parent.sys_path),
|
||||
[Path(node) for node in udevice.device_links],
|
||||
{attr: udevice.properties[attr] for attr in udevice.properties},
|
||||
[Path(node.sys_path) for node in udevice.children],
|
||||
|
@ -108,7 +108,7 @@ class StoreManager(CoreSysAttributes):
|
||||
self.repositories[repository.slug] = repository
|
||||
|
||||
repos = new_rep - old_rep
|
||||
tasks = [_add_repository(url) for url in repos]
|
||||
tasks = [self.sys_create_task(_add_repository(url)) for url in repos]
|
||||
if tasks:
|
||||
await asyncio.wait(tasks)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user