mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
In the future this should help us leak fewer names into the pyscript namespace. Rather than assigning to the pyscript module from JavaScript, we mount a separate private JS module with the extra names needed by PyScript. I moved a bit more interpeter intialization into remote_interpreter. I added a deprecation warning for `pyscript.js`: the proper way to access `js` is `import js`. --------- Co-authored-by: Antonio Cuni <anto.cuni@gmail.com>
30 lines
805 B
Python
30 lines
805 B
Python
"""All data required for testing examples"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
pyscriptjs = Path(__file__).parents[2]
|
|
|
|
# add pyscript folder to path
|
|
python_source = pyscriptjs / "src" / "python"
|
|
sys.path.append(str(python_source))
|
|
|
|
# add Python plugins folder to path
|
|
python_plugins_source = pyscriptjs / "src" / "plugins" / "python"
|
|
sys.path.append(str(python_plugins_source))
|
|
|
|
|
|
# patch pyscript module where needed
|
|
import pyscript_plugins_tester as ppt # noqa: E402
|
|
from pyscript import _plugin # noqa: E402
|
|
|
|
_plugin.define_custom_element = ppt.define_custom_element
|
|
|
|
|
|
@pytest.fixture()
|
|
def plugins_manager():
|
|
"""return a new instance of a Test version the PyScript application plugins manager"""
|
|
yield ppt.plugins_manager # PluginsManager()
|
|
ppt.plugins_manager.reset()
|