Enable Ruff PT012 (#113957)

This commit is contained in:
Sid 2024-06-08 17:59:08 +02:00 committed by GitHub
parent 915658daa1
commit 721b2c2ca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 341 additions and 429 deletions

View file

@ -602,7 +602,9 @@ def test_x10_address() -> None:
schema = vol.Schema(cv.x10_address)
with pytest.raises(vol.Invalid):
schema("Q1")
with pytest.raises(vol.Invalid):
schema("q55")
with pytest.raises(vol.Invalid):
schema("garbage_addr")
schema("a1")
@ -809,6 +811,7 @@ def test_multi_select() -> None:
with pytest.raises(vol.Invalid):
schema("robban")
with pytest.raises(vol.Invalid):
schema(["paulus", "martinhj"])
schema(["robban", "paulus"])
@ -1335,7 +1338,7 @@ def test_key_value_schemas() -> None:
with pytest.raises(vol.Invalid) as excinfo:
schema(True)
assert str(excinfo.value) == "Expected a dictionary"
assert str(excinfo.value) == "Expected a dictionary"
for mode in None, {"a": "dict"}, "invalid":
with pytest.raises(vol.Invalid) as excinfo:
@ -1373,7 +1376,7 @@ def test_key_value_schemas_with_default() -> None:
with pytest.raises(vol.Invalid) as excinfo:
schema(True)
assert str(excinfo.value) == "Expected a dictionary"
assert str(excinfo.value) == "Expected a dictionary"
for mode in None, {"a": "dict"}, "invalid":
with pytest.raises(vol.Invalid) as excinfo: