Skip to content

Commit

Permalink
Fix test-processors type-hints (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad authored Sep 24, 2024
1 parent 175e6f0 commit 03f80b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ disable_error_code = [
"index"
]

[[tool.mypy.overrides]]
module = "tests.core.test_processors"
disable_error_code = [
"assignment",
"index",
"var-annotated"
]

[[tool.mypy.overrides]]
module = "tests.wrapper"
disable_error_code = [
Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_processors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict
from typing import Any, Dict, List

from nornir.core import Nornir
from nornir.core.inventory import Host
Expand Down Expand Up @@ -40,7 +40,7 @@ def task_instance_completed(self, task: Task, host: Host, result: MultiResult) -
self.data[task.name][host.name]["failed"] = result.failed

def _get_subtask_dict(self, task: Task, host: Host) -> Dict[str, Any]:
parents = []
parents: List[str] = []
parent = task.parent_task
while True:
if parent is None:
Expand All @@ -65,7 +65,7 @@ def subtask_instance_completed(self, task: Task, host: Host, result: MultiResult

class Test:
def test_processor(self, nornir: Nornir) -> None:
data = {}
data: Dict[str, Any] = {}
nornir.with_processors([MockProcessor(data)]).run(task=mock_task)
assert data == {
"mock_task": {
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_processor(self, nornir: Nornir) -> None:
}

def test_processor_subtasks(self, nornir: Nornir) -> None:
data = {}
data: Dict[str, Any] = {}
nornir.with_processors([MockProcessor(data)]).run(task=mock_subtask)
assert data == {
"mock_subtask": {
Expand Down

0 comments on commit 03f80b1

Please sign in to comment.