Skip to content

Commit

Permalink
Don't add plugin to manager twice (#1064)
Browse files Browse the repository at this point in the history
* Prevent Python plugins from being added to PluginManager twice
  • Loading branch information
JeffersGlass committed Dec 21, 2022
1 parent c0f36aa commit 059dbc8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pyscriptjs/src/python/pyscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ def __init__(self, name=None):

def init(self, app):
self.app = app
self.app.plugins.addPythonPlugin(create_proxy(self))

def register_custom_element(self, tag):
# TODO: Ideally would be better to use the logger.
Expand Down
2 changes: 1 addition & 1 deletion pyscriptjs/tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_execution_hooks(self):
# EXPECT it to log the correct logs for the events it intercepts
log_lines = self.console.log.lines
for method in hooks_available:
assert f"{method} called" in log_lines
assert log_lines.count(f"{method} called") == 1

# EXPECT it to NOT be called (hence not log anything) the events that happen
# before it's ready, hence is not called
Expand Down

0 comments on commit 059dbc8

Please sign in to comment.