Error after installation of allure pytest adaptor

Question:

I am trying to configure Allure (2.6.0) with Pytest (3.6xx) on a Windows 8 box.
I am able to run pytest and generate jUnit xml report file which later I can pass to allure (allure server jUnitXmlFile.xml) and it works fine.

What I need is the additional functionality that Allure provides (metadata,attachments, etc), so I downloaded pytest-allure-adaptor.

So I have the following packages installed in my venv:

allure-pytest==2.4.1
allure-python-commons==2.4.1
pytest-allure-adaptor==1.7.10
...

If I now run py.test.exe, I get the following error:

(venv) c:TestAutomation>py.test.exe
Traceback (most recent call last):
  File "C:ToolsWinPythonpython-3.6.5.amd64Librunpy.py", line 193, in 
_run_module_as_main
    "__main__", mod_spec)
  File "C:ToolsWinPythonpython-3.6.5.amd64Librunpy.py", line 85, in 
_run_code
    exec(code, run_globals)
  File "c:TestAutomationvenvScriptspy.test.exe__main__.py", line 9, in 
<module>
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 52, 
in main
    config = _prepareconfig(args, plugins)
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
163, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "c:testautomationvenvlibsite-packagespluggycallers.py", line 
196, in _multicall
    gen.send(outcome)
  File "c:testautomationvenvlibsite-packages_pytesthelpconfig.py", line 
68, in pytest_cmdline_parse
    config = outcome.get_result()
 File "c:testautomationvenvlibsite-packagespluggycallers.py", line 76, 
in get_result
    raise ex[1].with_traceback(ex[2])
 File "c:testautomationvenvlibsite-packagespluggycallers.py", line 180, 
in _multicall
    res = hook_impl.function(*args)
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
941, in pytest_cmdline_parse
    self.parse(args)
 File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
1091, in parse
    self._preparse(args, addopts=addopts)
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
1053, in _preparse
    self.pluginmanager.load_setuptools_entrypoints('pytest11')
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
403, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
260, in register
    ret = super(PytestPluginManager, self).register(plugin, name)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
254, in register
    hook._maybe_apply_history(hookimpl)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
650, in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "c:testautomationvenvlibsite-packagespluggy__init__.py", line 
216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "c:testautomationvenvlibsite-packagespluggycallers.py", line 
201, in _multicall
    return outcome.get_result()
  File "c:testautomationvenvlibsite-packagespluggycallers.py", line 76, 
in get_result
    raise ex[1].with_traceback(ex[2])
  File "c:testautomationvenvlibsite-packagespluggycallers.py", line 
180, in _multicall
    res = hook_impl.function(*args)
  File "c:testautomationvenvlibsite-packagesallure_pytestplugin.py", 
line 20, in pytest_addoption
   help="Generate Allure report in the specified directory (may not exist)")
  File "c:testautomationvenvlibsite-packages_pytestconfig.py", line 
759, in addoption
    raise ValueError("option names %s already added" % conflict)
 ValueError: option names {'--alluredir'} already added

Is there something wrong with the pytest-allure-adaptor ?
Anyone have similar problems?

Asked By: ColdAir

||

Answers:

allure-python-commons is incompatible with pytest-allure-adaptor. You need to remove old plugin and reinstall allure-pytest and allure-python-commons.

Answered By: thistle

Your pytest-allure-adaptor is incompatible. Only thing is required to run this pip command if you have python2-

pip uninstall pytest-allure-adaptor

else run this command if you have python3 –

pip3 uninstall pytest-allure-adaptor
Answered By: Shivam Bharadwaj
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.