allure-framework / allure-pytest

Deprecated, please use https://github.com/allure-framework/allure-python instead
Other
171 stars 83 forks source link

Plugin already registered #117

Closed TimurNurlygayanov closed 7 years ago

TimurNurlygayanov commented 7 years ago

How To Reproduce: 1) Run PyTest command with allure report 2) Run the same command one more time (with the same path to allure reports)

Expected Result: Everything works just fine.

Observed Result: PyTest crashed with "Plugin already registered" error:

========================================================= ERRORS ========================================================= _____ ERROR collecting ____ testdev/local/lib/python2.7/site-packages/py/_path/common.py:367: in visit for x in Visitor(fil, rec, ignore, bf, sort).gen(self): testdev/local/lib/python2.7/site-packages/py/_path/common.py:416: in gen for p in self.gen(subdir): testdev/local/lib/python2.7/site-packages/py/_path/common.py:416: in gen for p in self.gen(subdir): testdev/local/lib/python2.7/site-packages/py/_path/common.py:416: in gen for p in self.gen(subdir): testdev/local/lib/python2.7/site-packages/py/_path/common.py:416: in gen for p in self.gen(subdir): testdev/local/lib/python2.7/site-packages/py/_path/common.py:416: in gen for p in self.gen(subdir): testdev/local/lib/python2.7/site-packages/py/_path/common.py:406: in gen if p.check(dir=1) and (rec is None or rec(p))]) testdev/local/lib/python2.7/site-packages/_pytest/main.py:682: in _recurse ihook = self.gethookproxy(path) testdev/local/lib/python2.7/site-packages/_pytest/main.py:587: in gethookproxy my_conftestmodules = pm._getconftestmodules(fspath) testdev/local/lib/python2.7/site-packages/_pytest/config.py:339: in _getconftestmodules mod = self._importconftest(conftestpath) testdev/local/lib/python2.7/site-packages/_pytest/config.py:375: in _importconftest self.consider_conftest(mod) testdev/local/lib/python2.7/site-packages/_pytest/config.py:398: in consider_conftest if self.register(conftestmodule, name=conftestmodule.file): testdev/local/lib/python2.7/site-packages/_pytest/config.py:250: in register ret = super(PytestPluginManager, self).register(plugin, name) testdev/local/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py:351: in register (plugin_name, plugin, self._name2plugin)) E ValueError: Plugin already registered: /home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pandas/conftest.py=<module 'pandas.conftest' from '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pandas/conftest.py'> E {'cacheprovider': <module '_pytest.cacheprovider' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/cacheprovider.pyc'>, 'debugging': <module '_pytest.debugging' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/debugging.pyc'>, 'pytestconfig': <_pytest.config.Config object at 0x7ff5b3a34690>, 'helpconfig': <module '_pytest.helpconfig' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/helpconfig.pyc'>, 'runner': <module '_pytest.runner' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/runner.pyc'>, 'unittest': <module '_pytest.unittest' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/unittest.pyc'>, '140693277582352': <_pytest.config.PytestPluginManager object at 0x7ff5b4d52410>, 'xdist': <module 'xdist.plugin' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/xdist/plugin.py'>, 'pastebin': <module '_pytest.pastebin' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/pastebin.pyc'>, 'skipping': <module '_pytest.skipping' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/skipping.pyc'>, 'session': <Session 'allure_report'>, 'lfplugin': <_pytest.cacheprovider.LFPlugin instance at 0x7ff5b0479488>, 'fixtures': <module '_pytest.fixtures' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/fixtures.pyc'>, 'tmpdir': <module '_pytest.tmpdir' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/tmpdir.pyc'>, 'capture': <module '_pytest.capture' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/capture.pyc'>, 'terminalreporter': <_pytest.terminal.TerminalReporter instance at 0x7ff5b0481320>, '140693201667792': <pytest_ignore_flaky.PluginIgnoreFlaky object at 0x7ff5b04ec6d0>, '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pylint/test/conftest.py': <module 'conftest' from '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pylint/test/conftest.py'>, '140693201667600': <allure.pytest_plugin.AllureAgregatingListener object at 0x7ff5b04ec610>, 'assertion': <module '_pytest.assertion' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/assertion/init__.pyc'>, 'mark': <module '_pytest.mark' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/mark.pyc'>, 'terminal': <module '_pytest.terminal' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/terminal.pyc'>, 'main': <module '_pytest.main' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/main.pyc'>, 'nose': <module '_pytest.nose' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/nose.pyc'>, 'xdist.boxed': <module 'xdist.boxed' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/xdist/boxed.py'>, 'xdist.looponfail': <module 'xdist.looponfail' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/xdist/looponfail.py'>, '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pandas/conftest.py': <module 'pandas.conftest' from '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/pandas/conftest.py'>, '140693201667984': <_pytest.junitxml.LogXML object at 0x7ff5b04ec790>, 'python': <module '_pytest.python' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/python.pyc'>, '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/wheel/test/conftest.py': <module 'wheel.test.conftest' from '/home/qawizard/automated-tests/testdev/lib/python2.7/site-packages/wheel/test/conftest.py'>, 'pytest_ignore_flaky': <module 'pytest_ignore_flaky' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/pytest_ignore_flaky.py'>, 'pylint': <module 'pytest_pylint' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/pytest_pylint.py'>, 'recwarn': <module '_pytest.recwarn' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/recwarn.pyc'>, 'funcmanage': <_pytest.fixtures.FixtureManager instance at 0x7ff5b04930e0>, '140693201667728': <allure.pytest_plugin.AllureCollectionListener object at 0x7ff5b04ec690>, 'monkeypatch': <module '_pytest.monkeypatch' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/monkeypatch.pyc'>, 'resultlog': <module '_pytest.resultlog' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/resultlog.pyc'>, 'allure_adaptor': <module 'allure.pytest_plugin' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/allure/pytest_plugin.py'>, '140693201667536': <allure.pytest_plugin.AllureTestListener object at 0x7ff5b04ec5d0>, '/home/qawizard/automated-tests/tests/conftest.py': <module 'tests.conftest' from '/home/qawizard/automated-tests/tests/conftest.py'>, 'setuponly': <module '_pytest.setuponly' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/setuponly.pyc'>, 'capturemanager': <_pytest.capture.CaptureManager instance at 0x7ff5b04e5cf8>, 'junitxml': <module '_pytest.junitxml' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/junitxml.pyc'>, 'doctest': <module '_pytest.doctest' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/doctest.pyc'>, 'timeout': <module 'pytest_timeout' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/pytest_timeout.py'>, 'setupplan': <module '_pytest.setupplan' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/setupplan.pyc'>, 'freeze_support': <module '_pytest.freeze_support' from '/home/qawizard/automated-tests/testdev/local/lib/python2.7/site-packages/_pytest/freeze_support.pyc'>} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

sseliverstov commented 7 years ago

New plugin is not compatible with old version. It use same entry points and module names. Please uninstall old plugin and try again.

TimurNurlygayanov commented 7 years ago

sseliverstov, it was a new installation with the latest version of the plugin.

The root of the issue not in different versions of the plugin, but in two different test executions which use the same folder for allure reports.

luarvik-od commented 7 years ago

Have faced with the same problem. C:\Users\igor.k\AppData\Local\Programs\Python\Python36\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.2\helpers\pycharm_jb_pytest_runner.py" --path C:/Users/igor.k/.PyCharmCE2017.1/snaapy/snaapy-ui-tests/Tests/Tests_customer_dashboard Testing started at 1:31 PM ... Launching py.test with arguments C:/Users/igor.k/.PyCharmCE2017.1/snaapy/snaapy-ui-tests/Tests/Tests_customer_dashboard in C:\Users\igor.k.PyCharmCE2017.1\snaapy\snaapy-ui-tests\Tests\Tests_customer_dashboard Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.2\helpers\pycharm_jb_pytest_runner.py", line 27, in pytest.main(sys.argv[1:], plugins_to_load) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 49, in main config = _prepareconfig(args, plugins) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 158, in _prepareconfig pluginmanager=pluginmanager, args=args) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 745, in call return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 339, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 334, in _MultiCall(methods, kwargs, hook.spec_opts).execute() File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 613, in execute return _wrapped_call(hook_impl.function(args), self.execute) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 250, in _wrapped_call wrap_controller.send(call_outcome) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\helpconfig.py", line 34, in pytest_cmdline_parse config = outcome.get_result() File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 279, in get_result raise ex[1].with_traceback(ex[2]) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 265, in init self.result = func() File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 614, in execute res = hook_impl.function(args) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 928, in pytest_cmdline_parse self.parse(args) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 1086, in parse self._preparse(args, addopts=addopts) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 1048, in _preparse self.pluginmanager.load_setuptools_entrypoints(entrypoint_name) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 516, in load_setuptools_entrypoints self.register(plugin, name=ep.name) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\config.py", line 252, in register ret = super(PytestPluginManager, self).register(plugin, name) File "C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages_pytest\vendored_packages\pluggy.py", line 351, in register (plugin_name, plugin, self._name2plugin)) ValueError: Plugin already registered: allure_pytest=<module 'allure.pytest_plugin' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\allure\pytest_plugin.py'> {'2584530579808': <_pytest.config.PytestPluginManager object at 0x00000259C206F160>, 'pytestconfig': <_pytest.config.Config object at 0x00000259C20D6358>, 'mark': <module '_pytest.mark' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\mark.py'>, 'main': <module '_pytest.main' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\main.py'>, 'terminal': <module '_pytest.terminal' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\terminal.py'>, 'runner': <module '_pytest.runner' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\runner.py'>, 'python': <module '_pytest.python' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\python.py'>, 'fixtures': <module '_pytest.fixtures' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\fixtures.py'>, 'debugging': <module '_pytest.debugging' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\debugging.py'>, 'unittest': <module '_pytest.unittest' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\unittest.py'>, 'capture': <module '_pytest.capture' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\capture.py'>, 'skipping': <module '_pytest.skipping' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\skipping.py'>, 'tmpdir': <module '_pytest.tmpdir' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\tmpdir.py'>, 'monkeypatch': <module '_pytest.monkeypatch' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\monkeypatch.py'>, 'recwarn': <module '_pytest.recwarn' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\recwarn.py'>, 'pastebin': <module '_pytest.pastebin' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\pastebin.py'>, 'helpconfig': <module '_pytest.helpconfig' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\helpconfig.py'>, 'nose': <module '_pytest.nose' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\nose.py'>, 'assertion': <module '_pytest.assertion' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\assertion\init.py'>, 'junitxml': <module '_pytest.junitxml' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\junitxml.py'>, 'resultlog': <module '_pytest.resultlog' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\resultlog.py'>, 'doctest': <module '_pytest.doctest' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\doctest.py'>, 'cacheprovider': <module '_pytest.cacheprovider' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\cacheprovider.py'>, 'freeze_support': <module '_pytest.freeze_support' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\freeze_support.py'>, 'setuponly': <module '_pytest.setuponly' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\setuponly.py'>, 'setupplan': <module '_pytest.setupplan' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\setupplan.py'>, 'warnings': <module '_pytest.warnings' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\_pytest\warnings.py'>, 'teamcity.pytest_plugin': <module 'teamcity.pytest_plugin' from 'C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.2\helpers\pycharm\teamcity\pytest_plugin.py'>, 'allure_adaptor': <module 'allure.pytest_plugin' from 'C:\Users\igor.k\AppData\Local\Programs\Python\Python36\lib\site-packages\allure\pytest_plugin.py'>}

Process finished with exit code 1 Empty test suite.

Please, advice

sseliverstov commented 7 years ago

Can you say plugin version?

sseliverstov commented 7 years ago

It is happens when are both versions of allure plugin installed. Uninstall all allure plugins and allure-python-commons, then install one of your prefer version. Sometimes pip don't deletes files from .../site-packages/. If this issue stay actual, please, delete allure files from .../site-packages/ manually.