Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
089a3ab6d7
commit
00ec7f11f0
204 changed files with 908 additions and 921 deletions
|
@ -9,11 +9,11 @@ from homeassistant.components.nextbus.util import listify, maybe_first
|
|||
|
||||
@pytest.mark.parametrize(
|
||||
("input", "expected"),
|
||||
(
|
||||
[
|
||||
("foo", ["foo"]),
|
||||
(["foo"], ["foo"]),
|
||||
(None, []),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_listify(input: Any, expected: list[Any]) -> None:
|
||||
"""Test input listification."""
|
||||
|
@ -22,13 +22,13 @@ def test_listify(input: Any, expected: list[Any]) -> None:
|
|||
|
||||
@pytest.mark.parametrize(
|
||||
("input", "expected"),
|
||||
(
|
||||
[
|
||||
([], []),
|
||||
(None, None),
|
||||
("test", "test"),
|
||||
(["test"], "test"),
|
||||
(["test", "second"], "test"),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_maybe_first(input: list[Any] | None, expected: Any) -> None:
|
||||
"""Test maybe getting the first thing from a list."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue