aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_patch_targets_are_live.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_patch_targets_are_live.py')
-rw-r--r--packages/meshbay-node/tests/test_patch_targets_are_live.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/meshbay-node/tests/test_patch_targets_are_live.py b/packages/meshbay-node/tests/test_patch_targets_are_live.py
index c1dd905..7728ae6 100644
--- a/packages/meshbay-node/tests/test_patch_targets_are_live.py
+++ b/packages/meshbay-node/tests/test_patch_targets_are_live.py
@@ -75,7 +75,9 @@ def _patches(path: Path):
and isinstance(first, ast.Name) \
and isinstance(node.args[1], ast.Constant) \
and isinstance(node.args[1].value, str):
- target = _resolve(aliases.get(first.id, ""))
+ if first.id not in aliases:
+ continue # a local object, not a module: an attribute lookup, always live
+ target = _resolve(aliases[first.id])
yield target, node.args[1].value, node.lineno
elif name in ("setattr", "patch") and isinstance(first, ast.Constant) \
and isinstance(first.value, str) and "." in first.value: