Enable Ruff PT012 (#113957)
This commit is contained in:
parent
915658daa1
commit
721b2c2ca8
90 changed files with 341 additions and 429 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue