hass-core/tests/components/recorder
Joakim Plate c576a68d33
Upgrade pytest-aiohttp (#82475)
* Upgrade pytest-aiohttp

* Make sure executors, tasks and timers are closed

Some test will trigger warnings on garbage collect, these warnings
spills over into next test.

Some test trigger tasks that raise errors on shutdown, these spill
over into next test.

This is to mimic older pytest-aiohttp and it's behaviour on test
cleanup.

Discussions on similar changes for pytest-aiohttp are here:
https://github.com/pytest-dev/pytest-asyncio/pull/309

* Replace loop with event_loop

* Make sure time is frozen for tests

* Make sure the ConditionType is not async

  /home-assistant/homeassistant/helpers/template.py:2082: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    def wrapper(*args, **kwargs):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

* Increase litejet press tests with a factor 10

The times are simulated anyway, and we can't stop the normal
event from occuring.

* Use async handlers for aiohttp

tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
  /Users/joakim/src/hass/home-assistant/venv/lib/python3.9/site-packages/aiohttp/web_urldispatcher.py:189: DeprecationWarning: Bare functions are deprecated, use async ones
    warnings.warn(

* Switch to freezegun in modbus tests

The tests allowed clock to tick in between steps

* Make sure skybell object are fully mocked

Old tests would trigger attempts to post to could services:

```
DEBUG:aioskybell:HTTP post https://cloud.myskybell.com/api/v3/login/ Request with headers: {'content-type': 'application/json', 'accept': '*/*', 'x-skybell-app-id': 'd2b542c7-a7e4-4e1e-b77d-2b76911c7c46', 'x-skybell-client-id': '1f36a3c0-6dee-4997-a6db-4e1c67338e57'}
```

* Fix sorting that broke after rebase
2022-11-29 22:36:36 +01:00
..
__init__.py
common.py Fire events when long term statistics is updated (#82492) 2022-11-24 22:01:36 +01:00
db_schema_0.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_16.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_18.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_22.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_23.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_23_with_newer_columns.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
db_schema_25.py Support non-live database migration (#72433) 2022-07-22 15:11:34 +02:00
db_schema_28.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
test_backup.py Ensure recorder test fixture is setup before hass fixture (#80528) 2022-10-19 07:58:47 +02:00
test_filters.py Fix logbook not setting up with an recorder filter that has empty fields (#72869) 2022-06-01 22:12:00 -07:00
test_filters_with_entityfilter.py Ensure recorder test fixture is setup before hass fixture (#80528) 2022-10-19 07:58:47 +02:00
test_history.py Add CI job which runs recorder tests on MariaDB (#80586) 2022-10-19 13:04:28 +02:00
test_init.py Fire events when long term statistics is updated (#82492) 2022-11-24 22:01:36 +01:00
test_migrate.py Refactor recorder migration (#80175) 2022-10-13 08:11:54 +02:00
test_models.py Separate recorder database schema from other classes (#72977) 2022-06-07 14:41:43 +02:00
test_pool.py Make database access in the eventloop raise an exception (#71547) 2022-05-09 15:22:08 -05:00
test_purge.py Add CI job which runs recorder tests on MariaDB (#80586) 2022-10-19 13:04:28 +02:00
test_run_history.py Ensure recorder test fixture is setup before hass fixture (#80528) 2022-10-19 07:58:47 +02:00
test_statistics.py Validate common statistics DB schema errors on start (#79707) 2022-11-29 10:16:08 +01:00
test_statistics_v23_migration.py Apply hass-relative-import to recorder tests (#78734) 2022-09-19 12:35:03 +02:00
test_system_health.py Add CI job which runs recorder tests on MariaDB (#80586) 2022-10-19 13:04:28 +02:00
test_util.py Upgrade pytest-aiohttp (#82475) 2022-11-29 22:36:36 +01:00
test_websocket_api.py Add display unit to WS recorder/get_statistics_metadata (#82870) 2022-11-28 13:46:57 -05:00