Commit Graph

321 Commits

Author SHA1 Message Date
Erik Montnemery
f524edc4b9 Add pytest command line option to drop recorder db before test (#153527) 2025-10-05 22:36:24 +02:00
Erik Montnemery
4011d62ac7 Improve enable_migrate_event_ids recorder test fixture (#153470)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-10-02 21:03:26 +02:00
Erik Montnemery
7f63ba2087 Improve saved state of RestoreSensor when using freezegun (#152740) 2025-09-30 18:27:56 +02:00
J. Nick Koston
c1eb492616 Fix Bluetooth mock to prevent degraded mode repair issues in tests (#152081) 2025-09-10 17:19:15 -05:00
epenet
a7ca618327 Check badly formatted dhcp addresses in tests (#147814) 2025-09-04 13:43:51 +01:00
Erik Montnemery
210ec28f0a Fix bluetooth tests (#150978) 2025-08-21 09:38:42 +02:00
Joakim Plate
98e6e20079 Mock habluetooth adapters (#148919) 2025-08-12 10:46:31 -05:00
epenet
e47bdc06a0 Set docstyle convention to google in ruff (#148142) 2025-07-04 16:00:37 +02:00
Marc Mueller
2c13c70e12 Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
Marc Mueller
10874af19a Ignore lingering pycares shutdown thread (#146733) 2025-06-13 15:09:37 +02:00
Marc Mueller
5e377b89fc Update pytest-asyncio to 1.0.0 (#145988)
* Update pytest-asyncio to 1.0.0

* Remove event_loop fixture uses
2025-06-02 06:12:22 +02:00
Erik Montnemery
8e74f63d47 Create repair issue if not all add-ons or folders were backed up (#144999)
* Create repair issue if not all add-ons or folders were backed up

* Fix spelling

* Fix _collect_errors

* Make time patching by freezegun work with mashumaro

* Addd test to hassio

* Add fixture

* Fix generating list of folders

* Add issue creation tests

* Include name of failing add-on in message

* Improve code formatting

* Rename AddonError to AddonErrorData
2025-05-20 15:23:52 +02:00
Erik Montnemery
36a08d04c5 Fail tests which JSON serialize mocks (#144261)
* Fail tests which JSON serialize mocks

* Patch JSON helper earlier

* Check type instead of attribute
2025-05-05 19:06:54 +02:00
J. Nick Koston
2890fc7dd2 Only create a single resolver object if there are multiple aiohttp sessions (#144090) 2025-05-02 13:43:06 -05:00
Stefan Agner
f1b8c8855e Push country config to Supervisor (#143871) 2025-04-30 18:02:18 +02:00
Erik Montnemery
f7a9319122 Don't attempt to garbage collect objects leaked by previous modules (#143944) 2025-04-30 14:52:50 +02:00
J. Nick Koston
9c3b0952e0 Turn off autospec for zeroconf mocks (#143879) 2025-04-29 16:45:58 +02:00
J. Nick Koston
36081c69e0 Break apart zeroconf integration to prepare for WebSocket API (#143490) 2025-04-23 07:47:37 -10:00
J. Nick Koston
9b1ab34352 Fix hassio mocking in ESPHome dashboard tests (#143212) 2025-04-18 14:11:36 +02:00
Erik Montnemery
86622cd29d Remove unnecessary imports of http integration (#141899)
* Remove unnecessary imports of http integration

* Check reason for test failures

* Revert "Check reason for test failures"

This reverts commit 5ccf356ab0.

* Update tests
2025-03-31 11:30:20 +01:00
Jan Bouwhuis
bd4d0ec4b8 Add initial MQTT subentry support for notify entities (#138461)
* Add initial MQTT subentry support for notify entities

* Fix componts assigment is reset on device config. Translation tweaks

* Rephrase

* Go to summary menu when components are set up already - add test

* Fix suggested device info on config flow

* Invert

* Simplify subentry config flow and omit menu

* Use constants instead of literals

* More constants

* Teak some translations

* Only show save when the the entry is dirty

* Do not trigger an entry reload twice

* Remove encoding, entity_category

* Remove icon from mqtt subentry flow

* Separate entity settings and MQTT specific settings

* Remove object_id and refactor

* Migrate translations

* Make subconfig flow test extensible

* Make sub reconfig flow tests extensible

* Rename entity_platform_config step to mqtt_platform_config

* Make component unique ID independent from the name

* Move code for update of component data to helper

* Follow up on code review

* Skip dirty stuff

* Fix rebase issues #1

* Do not allow reconfig for entity platform/name, default QoS and refactor tests

* Add entity platform and entity name label to basic entity config dialog

* Rename to exclude_from_reconfig and make reconfig option not optional
2025-03-14 14:00:07 +01:00
epenet
377e0a64d1 Reset helpers.frame._REPORTED_INTEGRATIONS in between tests (#139924)
* Reset helpers.frame._REPORTED_INTEGRATIONS in between tests

* Rename

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-03-06 13:57:13 +01:00
Erik Montnemery
cc5c8bf5e3 Make helpers.frame.report_usage work when called from any thread (#139836)
* Make helpers.frame.report_usage work when called from any thread

* Address review comments, update tests

* Add test

* Update test

* Update recorder test

* Update tests
2025-03-05 19:37:34 +01:00
Erik Montnemery
cfaf18f942 Improve the mock_integration_frame test fixture (#139850)
* Improve the mock_integration_frame test fixture

* Update test
2025-03-05 18:42:34 +01:00
Erik Montnemery
ff4f4111d0 Minor adjustment of recorder helper (#138941) 2025-02-20 16:28:39 +00:00
Erik Montnemery
fb57284561 Remove helper.recorder.async_wait_recorder (#138935) 2025-02-20 15:02:22 +00:00
Erik Montnemery
af0a862aab Clean up translations for mocked integrations inbetween tests (#138732)
* Clean up translations for mocked integrations inbetween tests

* Adjust code, add test

* Fix docstring

* Improve cleanup, add test

* Fix test
2025-02-19 13:49:31 +01:00
Jan Bouwhuis
d6b7762dd6 Upgrade paho-mqtt API to v2 (#137613)
* Upgrade paho-mqtt API to v2

* Refactor on_connect callback

* Add tests

* Fix Tasmota tests
2025-02-13 22:13:19 +01:00
J. Nick Koston
bbbad90ca2 Fix race configuring zeroconf (#138425) 2025-02-13 14:17:06 -06:00
Marc Mueller
f822fd82bb Fix recorder fixture typing (#136174) 2025-01-21 18:18:05 -10:00
epenet
b11b36b523 Add more util aliases to import conventions (#136153) 2025-01-21 15:58:23 +01:00
Marc Mueller
24c50e0988 Fix aiodns DeprecationWarning in tests (#135921) 2025-01-18 08:04:01 -10:00
Joost Lekkerkerker
8a35261fd8 Remove unused noqas (#135583) 2025-01-15 10:02:18 +01:00
Joost Lekkerkerker
8db63adc11 Bump ruff to 0.9.1 (#135197) 2025-01-14 11:46:12 +01:00
Jan Bouwhuis
b93aa760c5 Refactor the MQTT option and reconfigure flow (#133342)
* Move entry options to entry.options en remove broker setup from mqtt option flow

* UPdate diagnostics to export both entry data and options

* Parameterize entry options directly not depending on migration

* Update tests to use v2 entry and add separate migration test

* use start_reconfigure_flow helper

* Update quality scale comment

* Do minor entry upgrade, and do not force to upgrade entry

* Ensure options are read from older entries

* Add comment

* Follow up on code review

* Assert config entry version checking the broker connection

* Update comment
2025-01-13 19:00:18 +01:00
epenet
5df7092f41 Improve formatting in core files (#135256)
* Adjust core files formatting

* Adjust translations script
2025-01-10 09:08:37 +01:00
J. Nick Koston
89c73f56b1 Migrate to using aiohttp-asyncmdnsresolver for aiohttp resolver (#134830) 2025-01-06 12:06:28 -10:00
epenet
899fb091fc Simplify access to hass in service calls (#133062) 2024-12-13 09:31:21 +01:00
epenet
d6f4a79b46 Remove workaround for flaky translation tests (#131628) 2024-11-27 08:37:36 -06:00
Sid
9e98e446a2 Bump ruff to 0.8.0 (#131273) 2024-11-22 16:53:26 +01:00
epenet
ef767c2b9f Improve tests for frame helper (#130046)
* Improve tests for frame helper

* Improve comments

* Add ids

* Apply suggestions from code review
2024-11-07 17:35:58 +01:00
epenet
91157c21ef Reapply "Fix unused snapshots not triggering failure in CI" (#129311) 2024-11-04 18:59:27 +01:00
Franck Nijhof
35b7c3038a Revert "Fix unused snapshots not triggering failure in CI" (#129223)
Revert "Fix unused snapshots not triggering failure in CI (#128162)"

This reverts commit e888a95bd1.
2024-10-26 16:12:47 +02:00
epenet
e888a95bd1 Fix unused snapshots not triggering failure in CI (#128162) 2024-10-26 07:15:51 +02:00
Erik Montnemery
f1e8675756 Set autouse flag on session scope bluetooth fixture (#126589) 2024-09-24 08:43:32 +02:00
epenet
02cb6a6af7 Force root import of references from other components (#125816)
* Force root import of references from other components

* Improve

* Adjust

* Tweak exceptions

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Adjust

* More

* Ignore violations in test

* Improve
2024-09-16 11:28:42 +02:00
Erik Montnemery
2a1df2063d Separate recorder test fixtures disabling context id migration (#125324)
* Separate recorder test fixtures disabling context id migration

* Fix test
2024-09-09 08:16:30 +02:00
Erik Montnemery
ce2ffde22e Update sensor recorder tests to async (#124061) 2024-08-18 13:20:58 -05:00
J. Nick Koston
b15ea58851 Relocate code to get scheduled TimerHandles (#123546) 2024-08-12 09:15:33 +02:00
Erik Montnemery
6840f27bc6 Verify respx mock routes are cleaned up when tests finish (#122852) 2024-07-30 17:12:58 +02:00