summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_ops.py')
-rw-r--r--packages/meshbay-node/tests/test_ops.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/meshbay-node/tests/test_ops.py b/packages/meshbay-node/tests/test_ops.py
index c118b5a..083f31e 100644
--- a/packages/meshbay-node/tests/test_ops.py
+++ b/packages/meshbay-node/tests/test_ops.py
@@ -44,9 +44,14 @@ def test_operations_take_state_and_nothing_web_shaped():
second copy. Every public operation therefore takes `state` first and
returns plain data.
"""
+ # Defined here, not merely visible here: an async helper imported into the
+ # module (`off_disk`, say) is not an operation, and reporting it as one says
+ # nothing about a second implementation appearing. Every real operation is
+ # written in this module, so nothing is lost by asking.
public = [(n, f) for n, f in vars(ops).items()
- if inspect.iscoroutinefunction(f) and not n.startswith("_")]
- assert public, "no operations found — did the module move?"
+ if inspect.iscoroutinefunction(f) and not n.startswith("_")
+ and getattr(f, "__module__", None) == ops.__name__]
+ assert len(public) > 30, "operations have gone missing — did the module move?"
for name, fn in public:
params = list(inspect.signature(fn).parameters)
assert params and params[0] == "state", (