mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-19 10:21:30 +00:00
CI: add type checking (#10997)
* Set up type checking with mypy. * Make mypy pass. * Use list() instead of sorted().
This commit is contained in:
parent
831787619a
commit
6088b0cff5
73 changed files with 442 additions and 175 deletions
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import csv
|
||||
|
|
@ -112,7 +114,7 @@ INVALID_CSV = [
|
|||
),
|
||||
]
|
||||
|
||||
INVALID_DIALECT = [
|
||||
INVALID_DIALECT: list[tuple[str, t.Any, t.Any, str]] = [
|
||||
(
|
||||
'invalid',
|
||||
{},
|
||||
|
|
@ -153,7 +155,7 @@ def test_invalid_csv(data, dialect, dialect_params, fieldnames):
|
|||
|
||||
|
||||
@pytest.mark.parametrize("dialect,dialect_params,fieldnames,data", INVALID_DIALECT)
|
||||
def test_invalid_dialect(data, dialect, dialect_params, fieldnames):
|
||||
def test_invalid_dialect(data: str, dialect: t.Any, dialect_params: t.Any, fieldnames: str) -> None:
|
||||
result = False
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue