Skip to content

Commit 20eb4c4

Browse files
committed
Don't require return types for setup_module and teardown_module (for pytest)
1 parent ec877a3 commit 20eb4c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flake8_missing_annotations/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ def visit_FunctionDef(self, function: ast.FunctionDef) -> None:
240240

241241
offending_arguments.append(f"argument {arg.arg!r} is missing a type annotation")
242242

243-
if not is_test and function.returns is None and function_name not in {"__init__"}:
243+
if (
244+
not is_test and function.returns is None
245+
and function_name not in {"__init__", "setup_module", "teardown_module"}
246+
):
244247
offending_arguments.append(_no_return_annotation)
245248

246249
if offending_arguments:

0 commit comments

Comments
 (0)