Commit Graph

48 Commits (a88edc71303518bf7b21d49a20bcc0a7be28e68f)

Author SHA1 Message Date
epenet 313309a7e0
Remove deprecated YAML loaders (#130364) 2024-11-11 20:24:51 +01:00
Jan Morawiec 35ff3afa12
Refactor unittest tests to use pytest (#127770)
* Refactor unittest tests to use pytest

* Add type annotations

* Use caplog to assert logs

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-10-17 21:28:14 +02:00
Erik Montnemery 404a7bab18
Wrap OSError in loader.load_yaml (#124406) 2024-08-22 09:06:41 -05:00
Erik Montnemery ab6d0e3277
Handle !include without arguments in configuration.yaml (#124399)
* Prevent !include without arguments in configuration.yaml from crashing core

* Add test
2024-08-22 12:08:24 +02:00
Marc Mueller a6068dcdf2
Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
Marc Mueller ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
epenet 1974ea4fdd
Improve type hints in yaml util tests (#119358) 2024-06-11 15:01:54 +02:00
Sid 721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
Sid 895f73d8e4
Enable Ruff A001 (#115654) 2024-04-21 23:25:27 +02:00
Sid d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller a6b842f818
Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
Marc Mueller 19ab3d6daf
Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
J. Nick Koston 1fb9cfe37e
Speed up the frame helper (#112562) 2024-03-06 20:54:09 -10:00
Erik Montnemery 1cb5bbf865
Fix empty files included by !include_dir_named (#108489)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-20 15:12:32 +01:00
Pedro Lamas 6cab4486f7
Fix loading empty yaml files with include_dir_named (#107853) 2024-01-16 10:23:04 +01:00
Erik Montnemery 5b55c7da5f
Remove logic converting empty or falsy YAML to empty dict (#103912)
* Correct logic converting empty YAML to empty dict

* Modify according to github comments

* Add load_yaml_dict helper

* Update check_config script

* Update tests
2023-12-05 18:08:11 +01:00
Erik Montnemery 5b59e043fa
Don't use deprecated_class decorator on deprecated YAML classes (#105063) 2023-12-05 11:36:26 +01:00
Erik Montnemery ae002e2f38
Remove breaks_in_ha_version from deprecated YAML classes (#105062) 2023-12-05 10:48:31 +01:00
Erik Montnemery db51a8e1f7
Allow passing breaks_in_ha_version to deprecation helper decorators (#104985) 2023-12-04 11:52:10 +01:00
Erik Montnemery 34d01719f2
Minor improvements of deprecation helper (#104980) 2023-12-04 10:47:49 +01:00
Erik Montnemery 00e57ab9a4
Use deprecated_class decorator in deprecated YAML loader classes (#104835) 2023-11-30 22:43:34 +01:00
Erik Montnemery abc05451a2
Restore renamed yaml loader classes and warn when used (#104818) 2023-11-30 18:14:48 +01:00
Erik Montnemery 12902b8a68
Add NodeStrClass.__voluptuous_compile__ (#104808) 2023-11-30 17:45:27 +01:00
Erik Montnemery f89194784d
Fix including yaml files with scalar values (#103914) 2023-11-13 15:23:50 +01:00
Erik Montnemery 1168956f8c
Small improvement of yaml util tests (#103853) 2023-11-12 19:14:52 +01:00
Erik Montnemery 859c5c48c4
Fix yaml loader tests to test both C and Python implementations (#103606) 2023-11-07 23:49:31 +01:00
Erik Montnemery c29b0cd05b
Correct line numbers in yaml node annotations (#103605) 2023-11-07 23:22:23 +01:00
Erik Montnemery 05deae09fc
Add file and line annotation to strings when loading yaml (#103586) 2023-11-07 17:10:15 +01:00
Ville Skyttä 6399d74c15
Remove unnnecessary pylint configs from core (#98704) 2023-08-22 23:12:12 +02:00
epenet a0f725dfcb
Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
epenet a51cc75f03
Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
Jan Bouwhuis 4f6a25b470
Allow parameterizing YAML config in tests (#87981)
* Add fixture to parameterize yaml config

* Apply to more tests

* Re-add @fixture label

* Add fixtures to patch yaml content and targets

* Typo

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update references to mock_yaml_configuration

* Apply new fixtures

* Apply to check_config tests

* Follow up comments

* Rename fixtures, update docstr

* Split paths

* Patch load_yaml_config_file instead

* sort

* Fix tests

* improve docst

* Rename fixtures

* sorting

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

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

* Improve docstr

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

* Improve docstr

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-20 16:57:12 +01:00
Franck Nijhof f67ebcade1
Enable Ruff SIM201 (#88171) 2023-02-15 14:43:02 +01:00
epenet 4142f0d15d
Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
Franck Nijhof e50a531cd9
Code styling tweaks to the tests - Part 2 (#86662)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2023-01-26 01:23:53 +01:00
epenet 30bf0634fe
Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
J. Nick Koston 48e82ff62f
Fix failure to raise on bad YAML syntax from include files (#75510)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-07-20 19:25:17 +02:00
J. Nick Koston 034c0c0593
Improve YAML Dump times with C Dumper (#73424) 2022-06-13 13:14:30 -07:00
J. Nick Koston dca4d3cd61
Significantly improve yaml load times when the C loader is available (#73337) 2022-06-13 08:44:46 -10:00
Franck Nijhof fa09cf663e
Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Franck Nijhof ad13a9295e
Merge multiple context managers in tests (#48146) 2021-03-27 09:17:15 +01:00
Paulus Schoutsen 2df644c6cc
Clean up secret loading (#47034) 2021-03-02 12:58:53 -08:00
Paulus Schoutsen 633a7aeb22
Remove deprecated credstash + keyring (#47033) 2021-02-25 09:48:19 +01:00
Tom Parker-Shemilt 27d16af36b
Don't allow recursive secrets loading (#41812)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-14 14:23:31 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 1c9c99571e
Use !input instead of !placeholder (#43820)
* Use !input instead of !placeholder

* Update input name

* Lint

* Move tests around
2020-12-01 18:21:36 +01:00