hass-core/tests
J. Nick Koston e798c30b8b
Fix statistics schema auto repair when there is bad data (#89903)
- If the user had previously duplicated data we could end up
  picking the next metadata_id and there could be stale rows
  in the database that have that metadata_id. This can only happen
  from bad manual migrations (which is what this is function
  is validating in the first place). To solve this we now insert
  data with a future date and look at the latest inserted row
  instead of the first.

Example
```
['stored_statistics',
  defaultdict(<class 'list'>,
              {'recorder.db_test_schema': [{'end': 948589200.0,
                                            'last_reset': None,
                                            'max': None,
                                            'mean': 2021.0,
                                            'min': None,
                                            'start': 948585600.0,
                                            'state': None,
                                            'sum': 394.5068},
                                          {'end': 1601946000.000001,
                                            'last_reset': 1601942400.000001,
                                            'max': 1.000000000000001,
                                            'mean': 1.000000000000001,
                                            'min': 1.000000000000001,
                                            'start': 1601942400.000001,
                                            'state': 1.000000000000001,
                                            'sum': 1.000000000000001}]})]
```
2023-03-20 00:06:23 -04:00
..
auth Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
backports Add return type to tests without arguments (#87613) 2023-02-07 14:20:06 +01:00
components Fix statistics schema auto repair when there is bad data (#89903) 2023-03-20 00:06:23 -04:00
fixtures Unblock JSON CI by fixing improperly indented JSON in test fixture (#88803) 2023-02-26 14:41:16 -06:00
hassfest Add type hints to core tests (#88478) 2023-02-20 11:42:56 +01:00
helpers Fix lingering timer in config entry flow tests (#89853) 2023-03-19 08:56:24 +01:00
pylint Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
resources
scripts Allow parameterizing YAML config in tests (#87981) 2023-02-20 16:57:12 +01:00
test_util Adjust json imports in tests (#88248) 2023-02-17 19:13:48 +01:00
testing_config Add an in-memory-preloading loader for Jinja imports (#88850) 2023-03-13 11:00:05 +01:00
util Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
__init__.py
bandit.yaml
common.py Ensure MockEntityPlatform shuts down after tests (#89849) 2023-03-17 10:22:43 +01:00
conftest.py Cleanup get_local_ip in global conftest (#89826) 2023-03-16 22:03:06 +01:00
ignore_uncaught_exceptions.py
ruff.toml Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
syrupy.py Update entity registry snapshot serializer (#88566) 2023-02-21 22:37:13 +01:00
test_bootstrap.py Fix lingering timer in bootstrap tests (#89790) 2023-03-16 17:20:27 -04:00
test_config.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_config_entries.py Add type hints to root tests (#89785) 2023-03-16 11:08:47 +01:00
test_core.py Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
test_data_entry_flow.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_exceptions.py Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
test_loader.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_main.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_requirements.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_runner.py Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
test_setup.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_test_fixtures.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
typing.py Add MockHAClientWebSocket test helper (#87832) 2023-02-10 10:23:26 -05:00