You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/mitsuhiko/pluginbase/ pip install . pytest
Below is the error information:
===============================================================testsessionstarts================================================================platformlinux--Python3.9.17, pytest-6.2.5, py-1.11.0, pluggy-1.2.0rootdir: /home/v-lihaoran/reptile/pluginbaseplugins: xdist-2.5.0, anyio-3.7.1, lazy-fixture-0.6.3, mock-3.11.1, cov-2.12.1, forked-1.6.0collected9itemstests/test_advanced.pyFF [ 22%]
tests/test_basics.pyEEFFFE [ 88%]
tests/test_shutdown.pyF [100%]
======================================================================ERRORS======================================================================_______________________________________________________ERRORatsetupoftest_basic_plugin________________________________________________________request=<FixtureRequestfor<Functiontest_basic_plugin>>deffill(request):
item=request._pyfuncitemfixturenames=getattr(item, "fixturenames", None)
iffixturenamesisNone:
fixturenames=request.fixturenamesifhasattr(item, 'callspec'):
forparam, valinsorted_by_dependency(item.callspec.params, fixturenames):
ifvalisnotNoneandis_lazy_fixture(val):
item.callspec.params[param] =request.getfixturevalue(val.name)
elifparamnotinitem.funcargs:
item.funcargs[param] =request.getfixturevalue(param)
>_fillfixtures()
/anaconda/envs/test/lib/python3.9/site-packages/pytest_lazyfixture.py:39:
__________________________________________________________________________tests/conftest.py:19: insourcereturnbase.make_plugin_source(searchpath=['./plugins'],
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:213: inmake_plugin_sourcereturnPluginSource(self, *args, **kwargs)
__________________________________________________________________________self=<pluginbase.PluginSourceobjectat0x7f9fe6496340>, base=<pluginbase.PluginBaseobjectat0x7f9fe6496130>, identifier='demo'searchpath= ['./plugins'], persist=Falsedef__init__(self, base, identifier=None, searchpath=None,
persist=False):
#: indicates if this plugin source persists or not.self.persist=persistifidentifierisNone:
identifier=str(uuid.uuid4())
#: the identifier for this source.self.identifier=identifier#: A reference to the plugin base that created this source.self.base=base#: a list of paths where plugins are searched in.self.searchpath=searchpath#: The internal module name of the plugin source as it appears#: in the :mod:`pluginsource._internalspace`.self.spaceid='_sp'+hashlib.md5(
_to_bytes(self.base.package) +b'|'+_to_bytes(identifier),
).hexdigest()
#: a reference to the module on the internal#: :mod:`pluginsource._internalspace`.self.mod=_PluginSourceModule(self)
ifhasattr(_internalspace, self.spaceid):
>raiseRuntimeError('This plugin source already exists.')
ERuntimeError: Thispluginsourcealreadyexists.
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:271: RuntimeError__________________________________________________ERRORatsetupoftest_fetching_plugin_source___________________________________________________request=<FixtureRequestfor<Functiontest_fetching_plugin_source>>deffill(request):
item=request._pyfuncitemfixturenames=getattr(item, "fixturenames", None)
iffixturenamesisNone:
fixturenames=request.fixturenamesifhasattr(item, 'callspec'):
forparam, valinsorted_by_dependency(item.callspec.params, fixturenames):
ifvalisnotNoneandis_lazy_fixture(val):
item.callspec.params[param] =request.getfixturevalue(val.name)
elifparamnotinitem.funcargs:
item.funcargs[param] =request.getfixturevalue(param)
>_fillfixtures()
/anaconda/envs/test/lib/python3.9/site-packages/pytest_lazyfixture.py:39:
__________________________________________________________________________tests/conftest.py:19: insourcereturnbase.make_plugin_source(searchpath=['./plugins'],
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:213: inmake_plugin_sourcereturnPluginSource(self, *args, **kwargs)
__________________________________________________________________________self=<pluginbase.PluginSourceobjectat0x7f9fe63f7bb0>, base=<pluginbase.PluginBaseobjectat0x7f9fe63f7c10>, identifier='demo'searchpath= ['./plugins'], persist=Falsedef__init__(self, base, identifier=None, searchpath=None,
persist=False):
#: indicates if this plugin source persists or not.self.persist=persistifidentifierisNone:
identifier=str(uuid.uuid4())
#: the identifier for this source.self.identifier=identifier#: A reference to the plugin base that created this source.self.base=base#: a list of paths where plugins are searched in.self.searchpath=searchpath#: The internal module name of the plugin source as it appears#: in the :mod:`pluginsource._internalspace`.self.spaceid='_sp'+hashlib.md5(
_to_bytes(self.base.package) +b'|'+_to_bytes(identifier),
).hexdigest()
#: a reference to the module on the internal#: :mod:`pluginsource._internalspace`.self.mod=_PluginSourceModule(self)
ifhasattr(_internalspace, self.spaceid):
>raiseRuntimeError('This plugin source already exists.')
ERuntimeError: Thispluginsourcealreadyexists.
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:271: RuntimeError________________________________________________________ERRORatsetupoftest_load_plugin________________________________________________________request=<FixtureRequestfor<Functiontest_load_plugin>>deffill(request):
item=request._pyfuncitemfixturenames=getattr(item, "fixturenames", None)
iffixturenamesisNone:
fixturenames=request.fixturenamesifhasattr(item, 'callspec'):
forparam, valinsorted_by_dependency(item.callspec.params, fixturenames):
ifvalisnotNoneandis_lazy_fixture(val):
item.callspec.params[param] =request.getfixturevalue(val.name)
elifparamnotinitem.funcargs:
item.funcargs[param] =request.getfixturevalue(param)
>_fillfixtures()
/anaconda/envs/test/lib/python3.9/site-packages/pytest_lazyfixture.py:39:
__________________________________________________________________________tests/conftest.py:19: insourcereturnbase.make_plugin_source(searchpath=['./plugins'],
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:213: inmake_plugin_sourcereturnPluginSource(self, *args, **kwargs)
__________________________________________________________________________self=<pluginbase.PluginSourceobjectat0x7f9fe6458940>, base=<pluginbase.PluginBaseobjectat0x7f9fe6458610>, identifier='demo'searchpath= ['./plugins'], persist=Falsedef__init__(self, base, identifier=None, searchpath=None,
persist=False):
#: indicates if this plugin source persists or not.self.persist=persistifidentifierisNone:
identifier=str(uuid.uuid4())
#: the identifier for this source.self.identifier=identifier#: A reference to the plugin base that created this source.self.base=base#: a list of paths where plugins are searched in.self.searchpath=searchpath#: The internal module name of the plugin source as it appears#: in the :mod:`pluginsource._internalspace`.self.spaceid='_sp'+hashlib.md5(
_to_bytes(self.base.package) +b'|'+_to_bytes(identifier),
).hexdigest()
#: a reference to the module on the internal#: :mod:`pluginsource._internalspace`.self.mod=_PluginSourceModule(self)
ifhasattr(_internalspace, self.spaceid):
>raiseRuntimeError('This plugin source already exists.')
ERuntimeError: Thispluginsourcealreadyexists.
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:271: RuntimeError=====================================================================FAILURES=====================================================================________________________________________________________________test_custom_state_________________________________________________________________base=<pluginbase.PluginBaseobjectat0x7f9fe6496340>deftest_custom_state(base):
classApp(object):
name='foobar'source=base.make_plugin_source(searchpath=['./plugins'])
source.app=App()
>plg=source.load_plugin('advanced')
tests/test_advanced.py:10:
__________________________________________________________________________/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:301: inload_pluginreturn__import__(self.base.package+'.'+name,
__________________________________________________________________________self=<module'pluginbase.import_hook'>, name='dummy.plugins.advanced'globals= {'ModuleType': <class'module'>, 'NativeBytesIO': <class'_io.BytesIO'>, 'PY2': False, 'PluginBase': <class'pluginbase.PluginBase'>, ...}
locals= {}, fromlist= ['__name__'], level=0defplugin_import(self, name, globals=None, locals=None,
fromlist=None, level=None):
iflevelisNone:
# set the level to the default value specific to this python versionlevel=-1ifPY2else0import_name=nameifself.enabled:
ref_globals=globalsifref_globalsisNone:
ref_globals=sys._getframe(1).f_globalsspace=_discover_space(name, ref_globals)
ifspaceisnotNone:
actual_name=space._rewrite_module_path(name)
ifactual_nameisnotNone:
import_name=actual_name>returnself._system_import(import_name, globals, locals,
fromlist, level)
EModuleNotFoundError: Nomodulenamed'pluginbase._internalspace._sp8cf9ccbd2c645f151f331651bb414377.advanced'/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:438: ModuleNotFoundError______________________________________________________________test_plugin_resources_______________________________________________________________source=<pluginbase.PluginSourceobjectat0x7f9fe6458be0>deftest_plugin_resources(source):
>withsource.open_resource('withresources', 'hello.txt') asf:
tests/test_advanced.py:15:
__________________________________________________________________________/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:316: inopen_resourcemod=self.load_plugin(plugin)
/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:301: inload_pluginreturn__import__(self.base.package+'.'+name,
__________________________________________________________________________self=<module'pluginbase.import_hook'>, name='dummy.plugins.withresources'globals= {'ModuleType': <class'module'>, 'NativeBytesIO': <class'_io.BytesIO'>, 'PY2': False, 'PluginBase': <class'pluginbase.PluginBase'>, ...}
locals= {}, fromlist= ['__name__'], level=0defplugin_import(self, name, globals=None, locals=None,
fromlist=None, level=None):
iflevelisNone:
# set the level to the default value specific to this python versionlevel=-1ifPY2else0import_name=nameifself.enabled:
ref_globals=globalsifref_globalsisNone:
ref_globals=sys._getframe(1).f_globalsspace=_discover_space(name, ref_globals)
ifspaceisnotNone:
actual_name=space._rewrite_module_path(name)
ifactual_nameisnotNone:
import_name=actual_name>returnself._system_import(import_name, globals, locals,
fromlist, level)
EModuleNotFoundError: Nomodulenamed'pluginbase._internalspace._sp7bb7d8da1d24ae5a5205609c951b8be4.withresources'/anaconda/envs/test/lib/python3.9/site-packages/pluginbase.py:438: ModuleNotFoundError___________________________________________________________________test_cleanup___________________________________________________________________base=<pluginbase.PluginBaseobjectat0x7f9fe63c8d90>deftest_cleanup(base):
new_source=base.make_plugin_source(searchpath=['./plugins'])
mod_name=new_source.mod.__name__assertsys.modules.get(mod_name) isnew_source.modwithnew_source:
>fromdummy.pluginsimporthelloEImportError: cannotimportname'hello'from'pluginbase._internalspace._spff350f7f1d735bef78c28587b3641876' (unknownlocation)
tests/test_basics.py:60: ImportError___________________________________________________________________test_persist___________________________________________________________________base=<pluginbase.PluginBaseobjectat0x7f9fe64062b0>deftest_persist(base):
new_source=base.make_plugin_source(searchpath=['./plugins'],
persist=True)
mod_name=new_source.mod.__name__assertsys.modules.get(mod_name) isnew_source.modwithnew_source:
>fromdummy.pluginsimporthelloEImportError: cannotimportname'hello'from'pluginbase._internalspace._sp1f2dd722ad6c6e260b703039fbb0e803' (unknownlocation)
tests/test_basics.py:75: ImportError________________________________________________________________test_list_plugins_________________________________________________________________source=<pluginbase.PluginSourceobjectat0x7f9fe6459490>deftest_list_plugins(source):
plugins=source.list_plugins()
hello_plugins= [xforxinpluginsifx.startswith('hello')]
>asserthello_plugins== ['hello', 'hello2']
EAssertionError: assert [] == ['hello', 'hello2']
ERightcontains2moreitems, firstextraitem: 'hello'EUse-vtogetthefulldifftests/test_basics.py:88: AssertionError_______________________________________________________________test_clean_shutdown________________________________________________________________deftest_clean_shutdown():
env=dict(os.environ)
env['PYTHONPATH'] ='..:.'c=subprocess.Popen([sys.executable, '-c', 'import shutdown'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env)
stdout, stderr=c.communicate()
assertstdout==b''>assertstderr==b''EAssertionError: assertb'Traceback (...'shutdown\'\n' == b''
EUse-vtogetthefulldifftests/test_shutdown.py:15: AssertionError=============================================================shorttestsummaryinfo==============================================================FAILEDtests/test_advanced.py::test_custom_state-ModuleNotFoundError: Nomodulenamed 'pluginbase._internalspace._sp8cf9ccbd2c645f151f331651bb4...
FAILEDtests/test_advanced.py::test_plugin_resources-ModuleNotFoundError: Nomodulenamed 'pluginbase._internalspace._sp7bb7d8da1d24ae5a5205609...
FAILEDtests/test_basics.py::test_cleanup-ImportError: cannotimportname'hello'from 'pluginbase._internalspace._spff350f7f1d735bef78c28587b3...
FAILEDtests/test_basics.py::test_persist-ImportError: cannotimportname'hello'from 'pluginbase._internalspace._sp1f2dd722ad6c6e260b703039fb...
FAILEDtests/test_basics.py::test_list_plugins-AssertionError: assert [] == ['hello', 'hello2']
FAILEDtests/test_shutdown.py::test_clean_shutdown-AssertionError: assertb'Traceback (...'shutdown\'\n' == b''
ERRORtests/test_basics.py::test_basic_plugin-RuntimeError: Thispluginsourcealreadyexists.
ERRORtests/test_basics.py::test_fetching_plugin_source-RuntimeError: Thispluginsourcealreadyexists.
ERRORtests/test_basics.py::test_load_plugin-RuntimeError: Thispluginsourcealreadyexists.
===========================================================6failed, 3errorsin0.25s============================================================
The text was updated successfully, but these errors were encountered:
git clone https://github.com/mitsuhiko/pluginbase/
pip install .
pytest
Below is the error information:
The text was updated successfully, but these errors were encountered: