From afcd15522e6a8474270e5e028bc498baffac631a Mon Sep 17 00:00:00 2001 From: PrettyWood Date: Thu, 9 Dec 2021 09:55:45 +0100 Subject: [PATCH] fix: coverage Following https://github.com/samuelcolvin/pydantic/pull/3247 it seems that this case is not triggered anymore. We still keep it just in case --- pydantic/mypy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pydantic/mypy.py b/pydantic/mypy.py index 9aa0878..119c1a0 100644 --- a/pydantic/mypy.py +++ b/pydantic/mypy.py @@ -270,7 +270,9 @@ class PydanticModelTransformer: # Basically, it is an edge case when dealing with complex import logic # This is the same logic used in the dataclasses plugin continue - if not isinstance(node, Var): + if not isinstance(node, Var): # pragma: no cover + # Don't know if this edge case still happens with the `is_valid_field` check above + # but better safe than sorry continue # x: ClassVar[int] is ignored by dataclasses.