Skip to content

Commit 8915349

Browse files
committed
Disable some pylint checks for all test functions
Move the `pylint: disable=xxx` directive to the point in the file where we start to write the test functions, as we always want to ignore those checks for these type of functions. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 1b4812d commit 8915349

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_dispatch_cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ def mock_client(fake_client: FakeClient) -> Generator[None, None, None]:
4848
yield
4949

5050

51+
# For test functions we want to disable some pylint checks, we need many
52+
# arguments to pass fixtures, these functions are not meant to be called directly, and
53+
# having too many locals in tests is not a problem either.
54+
# pylint: disable=too-many-arguments,too-many-locals
55+
56+
5157
@pytest.mark.asyncio
5258
@pytest.mark.parametrize(
5359
"dispatches, microgrid_id, expected_output, expected_return_code",
@@ -142,7 +148,7 @@ def mock_client(fake_client: FakeClient) -> Generator[None, None, None]:
142148
),
143149
],
144150
)
145-
async def test_list_command( # pylint: disable=too-many-arguments
151+
async def test_list_command(
146152
runner: CliRunner,
147153
fake_client: FakeClient,
148154
dispatches: dict[int, list[Dispatch]],
@@ -305,7 +311,7 @@ async def test_list_command( # pylint: disable=too-many-arguments
305311
),
306312
],
307313
)
308-
async def test_create_command( # pylint: disable=too-many-arguments,too-many-locals
314+
async def test_create_command(
309315
runner: CliRunner,
310316
fake_client: FakeClient,
311317
args: list[str],
@@ -529,7 +535,7 @@ async def test_create_command( # pylint: disable=too-many-arguments,too-many-lo
529535
),
530536
],
531537
)
532-
async def test_update_command( # pylint: disable=too-many-arguments
538+
async def test_update_command(
533539
runner: CliRunner,
534540
fake_client: FakeClient,
535541
dispatches: list[Dispatch],
@@ -631,7 +637,7 @@ async def test_get_command(
631637
),
632638
],
633639
)
634-
async def test_delete_command( # pylint: disable=too-many-arguments
640+
async def test_delete_command(
635641
runner: CliRunner,
636642
fake_client: FakeClient,
637643
dispatches: list[Dispatch],

0 commit comments

Comments
 (0)