(self, node: ast.Assign)
| 884 | self._function_depth -= 1 |
| 885 | |
| 886 | def visit_Assign(self, node: ast.Assign) -> None: |
| 887 | if self._input_stack: |
| 888 | ctx = self._input_stack[-1] |
| 889 | for target in node.targets: |
| 890 | if not isinstance(target, ast.Name): |
| 891 | continue |
| 892 | if ctx.is_query(node.value): |
| 893 | ctx.query_locals.add(target.id) |
| 894 | elif ctx.is_body(node.value): |
| 895 | ctx.body_locals.add(target.id) |
| 896 | if ( |
| 897 | _is_tests_path(self.filename) |
| 898 | and self._function_depth == 0 |
| 899 | and len(node.targets) == 1 |
| 900 | and isinstance(node.targets[0], ast.Name) |
| 901 | and isinstance(node.value, ast.Call) |
| 902 | ): |
| 903 | y = _wall_clock_year_from_datetime_call(node.value) |
| 904 | if y is not None and y >= self._s015_year: |
| 905 | self.errors.append((node.lineno, node.col_offset, self._s015_msg)) |
| 906 | self.generic_visit(node) |
| 907 | |
| 908 | def _check_S021(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: |
| 909 | annot = _extract_response_annotation_Ts(node.returns) |
nothing calls this directly
no test coverage detected