Commit Graph

30 Commits (5446dd92a977615f3e83cdb9469c900f503a5824)

Author SHA1 Message Date
epenet 07f095aa42
Use service_calls fixture in core platform tests [a-l] (#120904) 2024-07-01 19:27:50 +02:00
Marc Mueller 2f0dd6f704
Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenet abb8c58b87
Fix consider-using-tuple pylint warnings in core tests (#119463) 2024-06-12 12:35:01 +02:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
epenet 492b158818
Add return type hints in tests (a-i) (#118939) 2024-06-06 12:17:08 +02:00
epenet c7e065c413
Move enable_custom_integrations fixture to decorator (#118844) 2024-06-05 09:20:08 +02:00
J. Nick Koston ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
epenet 7e62061b9a
Improve typing for `calls` fixture in tests (a-l) (#118349)
* Improve typing for `calls` fixture in tests (a-l)

* More

* More
2024-05-29 09:06:48 +02:00
Marc Mueller efc54971d3
Update empty line formatting after module docstring (#114040) 2024-03-23 00:27:57 +01:00
Sid 00ec7f11f0
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Jan-Philipp Benecke 73f11064d7
Use `mock_platform` for button entity component tests instead of `hass.components` (#113627) 2024-03-16 12:47:59 -10:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
J. Nick Koston d885bf886a
Ensure button platform does not restore unavailable state (#108316) 2024-01-21 01:04:13 -10:00
J. Nick Koston 26cc6a5bb4
Add state caching to button entities (#108272) 2024-01-18 08:53:55 +01:00
Erik Montnemery 4bb6787909
Use real devices in button device action tests (#102717) 2023-10-24 23:39:47 +02:00
Erik Montnemery 223abb6dca
Use real devices in button device trigger tests (#102679) 2023-10-24 21:57:14 +02:00
Erik Montnemery 9b1b0937eb
Use entity registry id in button device actions (#95267) 2023-06-26 22:22:15 +02:00
Franck Nijhof a48030f5dd
Name unnamed buttons by their device class (#95084) 2023-06-22 23:51:41 +02:00
Erik Montnemery 49ec806046
Teach button device trigger about entity registry ids (#94965)
* Teach button device trigger about entity registry ids

* Update homekit_controller tests
2023-06-21 14:50:11 +02:00
Erik Montnemery 6a29ed8caa
Replace assert_lists_same with pytest_unordered in integrations a-f (#94900) 2023-06-20 20:22:31 +02:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet fa7acb4f0d
Add type hints to integration tests (part 3) (#87844) 2023-02-10 16:05:01 +01:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Franck Nijhof 51a9f65a01
Clean up unnecessary registry mocks from Core tests (#87726) 2023-02-08 13:28:44 -06:00
Franck Nijhof 24fdd588fd
Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Erik Montnemery 5e50a8abd5
Mark device triggers from hidden or auxiliary entities as secondary (#70335)
* Mark device triggers from hidden or auxiliary entities as secondary

* Update tests
2022-04-21 08:01:32 +02:00
Erik Montnemery 64381acbaf
Mark device actions from hidden or auxiliary entities as secondary (#70278) 2022-04-20 10:48:46 -07:00
Ville Skyttä 5926961ed5
Use DeviceAutomationType in tests/components/[a-f]* (#62440) 2021-12-20 22:26:29 +01:00
Franck Nijhof d126d88977
Add Button entity component platform (#57642)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-04 16:50:43 +01:00