Skip to content

Commit 91fe14c

Browse files
Remove unnecessary TypeVar
1 parent f0af0c5 commit 91fe14c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

anta/tests/snmp.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# mypy: disable-error-code=attr-defined
88
from __future__ import annotations
99

10-
from typing import TYPE_CHECKING, ClassVar, TypeVar, get_args
10+
from typing import TYPE_CHECKING, ClassVar, get_args
1111

1212
from pydantic import field_validator
1313

@@ -19,9 +19,6 @@
1919
if TYPE_CHECKING:
2020
from anta.models import AntaTemplate
2121

22-
# Using a TypeVar for the SnmpUser model since mypy thinks it's a ClassVar and not a valid type when used in field validators
23-
T = TypeVar("T", bound=SnmpUser)
24-
2522

2623
class VerifySnmpStatus(AntaTest):
2724
"""Verifies whether the SNMP agent is enabled in a specified VRF.
@@ -393,7 +390,7 @@ class Input(AntaTest.Input):
393390

394391
@field_validator("snmp_users")
395392
@classmethod
396-
def validate_snmp_users(cls, snmp_users: list[T]) -> list[T]:
393+
def validate_snmp_users(cls, snmp_users: list[SnmpUser]) -> list[SnmpUser]:
397394
"""Validate that 'auth_type' or 'priv_type' field is provided in each SNMPv3 user."""
398395
for user in snmp_users:
399396
if user.version == "v3" and not (user.auth_type or user.priv_type):

0 commit comments

Comments
 (0)