-
Notifications
You must be signed in to change notification settings - Fork 255
Description
I'm writing test cases with pytest-bdd and need allure reports with gherkin steps, but the report can't be generated properly.
Version info
allure-pytest 2.8.13
allure-pytest-bdd 2.8.13
allure-python-commons 2.8.13
pytest 5.4.1
pytest-bdd 3.3.0
pytest.ini
[pytest]
addopts = -vv --alluredir alluredir --clean-alluredir
Before allure-pytest-bdd is installed, test cases can run with following command line.
pytest step_defs\test_PayInfo.py
When allure-pytest-bdd is installed, I see error msg like
Traceback (most recent call last):
File "c:\python3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\python3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Python3\Scripts\pytest.exe_main.py", line 7, in
File "c:\python3\lib\site-packages_pytest\config_init.py", line 105, in main
config = prepareconfig(args, plugins)
File "c:\python3\lib\site-packages_pytest\config_init.py", line 258, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "c:\python3\lib\site-packages\pluggy\hooks.py", line 289, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "c:\python3\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "c:\python3\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "c:\python3\lib\site-packages\pluggy\callers.py", line 203, in multicall
gen.send(outcome)
File "c:\python3\lib\site-packages_pytest\helpconfig.py", line 90, in pytest_cmdline_parse
config = outcome.get_result()
File "c:\python3\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "c:\python3\lib\site-packages\pluggy\callers.py", line 187, in multicall
res = hook_impl.function(*args)
File "c:\python3\lib\site-packages_pytest\config_init.py", line 836, in pytest_cmdline_parse
self.parse(args)
File "c:\python3\lib\site-packages_pytest\config_init.py", line 1044, in parse
self.preparse(args, addopts=addopts)
File "c:\python3\lib\site-packages_pytest\config_init.py", line 992, in preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "c:\python3\lib\site-packages\pluggy\manager.py", line 293, in load_setuptools_entrypoints
self.register(plugin, name=ep.name)
File "c:\python3\lib\site-packages_pytest\config_init.py", line 379, in register
ret = super().register(plugin, name)
File "c:\python3\lib\site-packages\pluggy\manager.py", line 121, in register
hook._maybe_apply_history(hookimpl)
File "c:\python3\lib\site-packages\pluggy\hooks.py", line 336, in _maybe_apply_history
res = self._hookexec(self, [method], kwargs)
File "c:\python3\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "c:\python3\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "c:\python3\lib\site-packages\pluggy\callers.py", line 208, in _multicall
return outcome.get_result()
File "c:\python3\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "c:\python3\lib\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "c:\python3\lib\site-packages\allure_pytest_bdd\plugin.py", line 13, in pytest_addoption
help="Generate Allure report in the specified directory (may not exist)")
File "c:\python3\lib\site-packages_pytest\config\argparsing.py", line 353, in addoption
raise ValueError("option names %s already added" % conflict)
ValueError: option names {'--alluredir'} already added
Even if I remove --alluredir alluredir, it can't be solved.
Does anyone know how to resolve it? Thank you!