官术网_书友最值得收藏!

Keyword expressions: -k

Often, you don't exactly remember the full path or name of a test that you want to execute. At other times, many tests in your suite follow a similar pattern and you want to execute all of them because you just refactored a sensitive area of the code.

By using the -k <EXPRESSION> flag (from keyword expression), you can run tests whose item id loosely matches the given expression:

λ pytest -k "test_parse"

This will execute all tests that contain the string parse in their item IDs. You can also write simple Python expressions using Boolean operators:

λ pytest -k "parse and not num"

This will execute all tests that contain parse but not num in their item IDs.

主站蜘蛛池模板: 萨迦县| 冷水江市| 宣汉县| 香港 | 弋阳县| 布拖县| 泸水县| 金沙县| 栖霞市| 枞阳县| 巴彦淖尔市| 馆陶县| 潢川县| 古浪县| 延津县| 土默特右旗| 盐池县| 平度市| 固原市| 南皮县| 潢川县| 花垣县| 荥经县| 肃宁县| 五峰| 上犹县| 谷城县| 乌鲁木齐市| 永昌县| 津南区| 永吉县| 厦门市| 郎溪县| 马鞍山市| 象山县| 鄂伦春自治旗| 麻城市| 中江县| 宜宾市| 同德县| 石首市|