全栈自动化测试之pytest常用命令行参数

pytest --collect-only  搜集要运行的测试用例,不运行

匹配表达式  -k

D:\tools\pycharm\autotest>pytest -k "test_create_article or test_article_edit_alias" --collect-only                                               匹配包含test_create_article 或 test_article_edit_alias的用例
========================================================================================================== test session starts ===========================================================================================================
platform win32 -- Python 3.8.0, pytest-7.1.3, pluggy-1.0.0
rootdir: D:\tools\pycharm\autotest
plugins: html-3.1.1, metadata-2.0.2
collected 7 items / 3 deselected / 4 selected

<Package testcases>
<Module test_abnormal.py>
<Function test_create_article[article_data0-None]>
<Function test_create_article[article_data1-java.sql.SQLException: Incorrect integer value: 'AAA' for column 'typeId' at row 1]>
<Module test_article_create.py>
<Function test_create_article>
<Module test_article_update.py>
<Function test_article_edit_alias>

============================================================================================== 4/7 tests collected (3 deselected) in 1.88s ===============================================================================================

D:\tools\pycharm\autotest>pytest -k "test_ and _alias" --collect-only                                                         匹配包含test_  和  _alias的用例
========================================================================================================== test session starts ===========================================================================================================
platform win32 -- Python 3.8.0, pytest-7.1.3, pluggy-1.0.0
rootdir: D:\tools\pycharm\autotest
plugins: html-3.1.1, metadata-2.0.2
collected 7 items / 6 deselected / 1 selected

<Package testcases>
<Module test_article_update.py>
<Function test_article_edit_alias>

============================================================================================== 1/7 tests collected (6 deselected) in 1.75s ====================================&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值