ValueError: option names {'--alluredir'} already added 报错
运行测试用例
import pytest from WXP2P_2.test_data2.login_case import logindata_error1,logindata_error2,logindata_right class TestLogin: """测试登录""" @pytest.mark.parametrize("data",logindata_error1)#装饰测试用例。 @pytest.mark.wrong def test_error1(self,data,int_start): """错误信息""" int_start[0].login(data["use"],data["password"]) try: assert (int_start[0].error_value()==data["expected"]) print("测试用例通过,预期结果{}与实际结果{}一致".format(data["expected"],int_start[0].error_value())) except AssertionError as e: print("用例失败") raise e finally: int_start[0].clear()#清空输入框 # Login().login(data["use"], data["password"])#错误示范,这种调用方法,会多次打开浏览器 # Login().clear()#错误示范,这种调用方法,会多次打开网页 # @pytest.mark.parametrize("data",logindata_error2) # def test_error2(self, data): # """错误信息""" # self.login.login(data["use"], data["password"]) # try: # assert (self.login.error_value1() == data["expected"]) # print("测试用例通过,预期结果{}与实际结果{}一致".format(data["expected"], self.login.error_value1())) # except AssertionError as e: # print("用例失败") # raise e # finally: # self.login.clear() # 清空输入框 # @pytest.mark.ok # @pytest.mark.parametrize("data",logindata_right)#装饰测试用例 # def test_right(self,data): # """正确的信息登录""" # self.login.login(data["use"], data["password"]) # try: # assert (data["expected"] in self.login.right_value()) # print("测试用例通过,预期结果{}与实际结果{}一致".format(data["expected"], self.login.right_value())) # except AssertionError as e: # print("用例失败") # raise e # # Login().login(data["use"], data["password"])#错误示范,这种调用方法,会多次打开网页 if __name__ == '__main__': pytest.main(["-m wrong","-s"])
执行结果
Traceback (most recent call last): File "D:/WX_P2P_ITEM/WXP2P_2/test_login.py", line 46, in <module> pytest.main(["-m wrong","-s"]) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 60, in main config = _prepareconfig(args, plugins) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 204, in _prepareconfig pluginmanager=pluginmanager, args=args File "D:\Python\lib\site-packages\pluggy\hooks.py", line 289, in __call__ return self._hookexec(self, self.get_hookimpls(), kwargs) File "D:\Python\lib\site-packages\pluggy\manager.py", line 68, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "D:\Python\lib\site-packages\pluggy\manager.py", line 62, in <lambda> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, File "D:\Python\lib\site-packages\pluggy\callers.py", line 203, in _multicall gen.send(outcome) File "D:\Python\lib\site-packages\_pytest\helpconfig.py", line 93, in pytest_cmdline_parse config = outcome.get_result() File "D:\Python\lib\site-packages\pluggy\callers.py", line 80, in get_result raise ex[1].with_traceback(ex[2]) File "D:\Python\lib\site-packages\pluggy\callers.py", line 187, in _multicall res = hook_impl.function(*args) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 684, in pytest_cmdline_parse self.parse(args) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 901, in parse self._preparse(args, addopts=addopts) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 846, in _preparse self.pluginmanager.load_setuptools_entrypoints("pytest11") File "D:\Python\lib\site-packages\pluggy\manager.py", line 282, in load_setuptools_entrypoints self.register(plugin, name=ep.name) File "D:\Python\lib\site-packages\_pytest\config\__init__.py", line 318, in register ret = super(PytestPluginManager, self).register(plugin, name) File "D:\Python\lib\site-packages\pluggy\manager.py", line 102, in register hook._maybe_apply_history(hookimpl) File "D:\Python\lib\site-packages\pluggy\hooks.py", line 336, in _maybe_apply_history res = self._hookexec(self, [method], kwargs) File "D:\Python\lib\site-packages\pluggy\manager.py", line 68, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "D:\Python\lib\site-packages\pluggy\manager.py", line 62, in <lambda> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, File "D:\Python\lib\site-packages\pluggy\callers.py", line 208, in _multicall return outcome.get_result() File "D:\Python\lib\site-packages\pluggy\callers.py", line 80, in get_result raise ex[1].with_traceback(ex[2]) File "D:\Python\lib\site-packages\pluggy\callers.py", line 187, in _multicall res = hook_impl.function(*args) File "D:\Python\lib\site-packages\allure_pytest\plugin.py", line 21, in pytest_addoption help="Generate Allure report in the specified directory (may not exist)") File "D:\Python\lib\site-packages\_pytest\config\argparsing.py", line 303, in addoption raise ValueError("option names %s already added" % conflict) ValueError: option names {'--alluredir'} already added
这是因为pytest-allure-adaptor与allure-pytest的alluredir都被引用造成冲突
需要卸载pytest-allure-adaptor
卸载完成后,再执行测试模块
============================= test session starts ============================= platform win32 -- Python 3.6.3, pytest-4.5.0, py-1.8.0, pluggy-0.11.0 rootdir: D:\WX_P2P_ITEM\WXP2P_2 plugins: allure-pytest-2.6.5 collected 5 items / 3 deselected / 2 selected test_login.py 测试用例通过,预期结果请输入正确的手机号与实际结果请输入正确的手机号一致 .测试用例通过,预期结果请输入手机号与实际结果请输入手机号一致 .
ValueError: option names {'--alluredir'} already added 报错的更多相关文章
- moviepy音视频剪辑:使用fl_time进行时间特效处理报错ValueError: Attribute duration not set
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt+moviepy音视频剪辑实战 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 在使 ...
- Unity在OpenGL模式下Shader编译报错
报错信息 GLSL compilation failed: 0(21) : error C7528: OpenGL reserves names containing '__' 双击报错VS自动打开V ...
- Oracle Online Patching报错"This is not a RAC setup. OPatch cannot determine the local node name"
Oracle Online Patching报错"This is not a RAC setup. OPatch cannot determine the local node name&q ...
- 报错问题: AtrributeError:module ‘allure’ has no attribute ‘’severity_level’
问题:执行命令报错:pytest -s -q --alluredir report 报错问题: AtrributeError:module 'allure' has no attribute ''se ...
- weblogic启动报错之Unrecognized option: -jrockit
报错如下: $ ./startWebLogic.sh . . JAVA Memory arguments: -Xms512m -Xmx512m . WLS Start Mode=Production ...
- windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help
windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...
- Android报错:WindowManager$BadTokenException: Unable to add window -- window has already been added
很久之前测试通过的代码,现在手机升级了Android7.0后一运行就崩溃,报出这样的错误,具体错误如下: Process: com.example.sho.android_anti_theft, PI ...
- tensorflow-TFRecord报错ValueError: Protocol message Feature has no "feature" field.
编写代码用TFRecord数据结构存储数据集信息是报错:ValueError: Protocol message Feature has no "feature" field.或和 ...
- 关于SVN报错 svn: E170013 E125006: contains invalid filesystem format option 'addressing logical'
在使用svn的时候,遇到了这样的一个问题 首先我使用TortoiseSVN 右键创建的repository. 之后用IDEA,配置了1.9.4版本的SVN,去commit访问这个仓库 结果出现了以下的 ...
随机推荐
- bat批处理教程
批处理的本质,是一堆DOS命令按一定顺序排列而形成的集合 1.ping sz.tencent.com > a.txt 把前面信息放到a.txt中 ping sz.tencent.com > ...
- (Android)截图批处理
新建一个批处理文件 输入下面的内容 @echo off rem set name=%,%%,%%,%%,%%,%%,% //设置截图文件名称 set screenShotName=%,%%,%%,% ...
- JAG Practice Contest for ACM-ICPC Asia Regional 2016B题【BFS】
题意: 就是公主要逃跑,士兵要抓公主,问你能不能逃跑哇: 思路: 就是终点搞成起点,然后BFS一下就好了,最后枚举一下出口到公主的距离是不是<所有的到士兵的距离: #include <bi ...
- __enter__,__exit__
目录 上下文管理协议 模拟open 优点 我们知道在操作文件对象的时候可以这么写 with open('a.txt') as f: '代码块' 上述叫做上下文管理协议,即with语句,为了让一个对象兼 ...
- 笔记-JavaWeb学习之旅4
JDBC: 概念:Java DataBase Connectivity Java 数据库连接,Java语言操作数据库 本质:其实是官方(sun公司)定义的一套操作所有关系型数据库的规则,即接口,各个数 ...
- 自定义的cell上面有图片时,如果产生了重用,图片可能会错乱问题
当被重用的cell将要显示时,会调用这个方法,这个方法最大的用武之地是当你自定义的cell上面有图片时,如果产生了重用,图片可能会错乱(当图片来自异步下载时及其明显),这时我们可以重写这个方法把内容抹 ...
- [題解](并查集)luogu_P2391 白雪皚皚
今天被老師留的作業搞死了,全是裸的水題,難題就那麼兩道我還沒寫......,狗屎 1.倒序處理,每個點至多會被更新一次 2.所以要做的就是快速找到下一個不同顏色的點, 3.然而不知道怎麼就 想到用并查 ...
- UWP 播放媒体控件
最近我的uwp需要有一个有声朗读的功能,like this 点击声音按钮就可以有声朗读了.这里主要是用了媒体播放的控件. 一般我们把需求分为两种: 一种是不需要呈现播放器的样子,只需要用户点击一下别的 ...
- Arch Linux 安装记(安装到移动硬盘)
一转眼传说中装起来难于上青天,用起来险如上刀梯(容易滚挂),绰号“洗发水”并被戏称为“邪教”的 Arch Linux 已经用了几个月.某些关于其安装难度和稳定性的传说实在太夸张了,反而觉得这才是适合懒 ...
- JavaScript alert()函数
avaScript alert()函数 alert--弹出消息对话框(对话框中有一个OK按钮) alert,中文"提醒"的意思 alert函数语法 alert(str); aler ...