A visitor that collects filter and test calls.
| 194 | |
| 195 | |
| 196 | class DependencyFinderVisitor(NodeVisitor): |
| 197 | """A visitor that collects filter and test calls.""" |
| 198 | |
| 199 | def __init__(self): |
| 200 | self.filters = set() |
| 201 | self.tests = set() |
| 202 | |
| 203 | def visit_Filter(self, node): |
| 204 | self.generic_visit(node) |
| 205 | self.filters.add(node.name) |
| 206 | |
| 207 | def visit_Test(self, node): |
| 208 | self.generic_visit(node) |
| 209 | self.tests.add(node.name) |
| 210 | |
| 211 | def visit_Block(self, node): |
| 212 | """Stop visiting at blocks.""" |
| 213 | |
| 214 | |
| 215 | class UndeclaredNameVisitor(NodeVisitor): |