Skip to content

Commit eb93e56

Browse files
committed
fix error msg, add test
1 parent 0149237 commit eb93e56

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

streamz/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def stub(*args, **kwargs):
312312
raise TypeError(
313313
f"Error loading {entry_point.name} "
314314
f"from module {entry_point.module_name}: "
315-
f"{entry_point.cls.__name__} must be a subclass of Stream"
315+
f"{node.__class__.__name__} must be a subclass of Stream"
316316
)
317317
cls.register_api(
318318
modifier=modifier, attribute_name=entry_point.name

streamz/tests/test_plugins.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,17 @@ class invalid_node:
5353

5454
with pytest.raises(TypeError):
5555
Stream.test()
56+
57+
58+
def test_register_plugin_entry_point_already_registered():
59+
@Stream.register_api()
60+
class test(Stream):
61+
pass
62+
63+
entry_point = MockEntryPoint("test_double", test, "test_module")
64+
65+
Stream.register_plugin_entry_point(entry_point)
66+
67+
assert Stream.test_double.__name__ == "stub"
68+
Stream.test_double()
69+
assert Stream.test_double.__name__ == "test"

0 commit comments

Comments
 (0)