File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11repos :
2+ - repo : local
3+ hooks :
4+ - id : zuban
5+ name : zuban
6+ entry : uv run zuban check homeassistant_api
7+ language : system
8+ types : [python]
9+ pass_filenames : false
210 - repo : https://github.com/pre-commit/pre-commit-hooks
311 hooks :
412 - id : trailing-whitespace
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ docs = [
3030 " autodoc-pydantic>=2,<3" ,
3131]
3232dev = [
33- " pre-commit>=4,<5" ,
3433 " types-docutils>=0.22" ,
3534 " types-simplejson>=3.20" ,
3635 " types-toml>=0.10" ,
@@ -40,6 +39,7 @@ dev = [
4039 " pytest-cov>=7" ,
4140 " pytest>=8" ,
4241 " aiosqlite>=0.22" ,
42+ " prek>=0.3.8" ,
4343]
4444
4545[tool .pytest .ini_options ]
@@ -99,14 +99,9 @@ ignore = [
9999[tool .ruff .lint .isort ]
100100force-single-line = true
101101
102- [tool .mypy ]
103- disable_error_code = [
104- " no-untyped-def" ,
105- " name-defined" ,
106- ]
107- exclude = [
108- " ^docs/"
109- ]
102+ [tool .zuban ]
103+ exclude = [" ^docs/" ]
104+ untyped_function_return_mode = " inferred"
110105
111106[tool .hatch .build .targets .wheel ]
112107packages = [" homeassistant_api" ]
Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ def test_prepare_entity_histories_naive_timestamps() -> None:
7272 end_timestamp = naive_end ,
7373 )
7474 # Naive timestamps should get a timezone attached
75- assert "+" in url or "-" in url .split ("T " )[- 1 ], (
76- "start_timestamp should have timezone offset"
77- )
78- assert "+" in params [ "end_time" ] or "-" in params [ "end_time" ]. split ( "T" )[ - 1 ], (
79- " end_time should have timezone offset"
80- )
75+ start_time = datetime . fromisoformat ( url .split ("/ " )[- 1 ])
76+ assert start_time . tzinfo is not None , "start_timestamp should have timezone offset"
77+ end_time_str = params [ "end_time" ]
78+ assert end_time_str is not None
79+ end_time = datetime . fromisoformat ( end_time_str )
80+ assert end_time . tzinfo is not None , "end_time should have timezone offset"
8181
8282
8383# --- BaseClient: prepare_get_logbook_entry_params ---
You can’t perform that action at this time.
0 commit comments