Pytest-Priority
为用例添加优先级标记,并支持按优先级筛选用例执行
安装方法
pip install pytest-priority
使用方法
- 标记优先级
# test_demo.py
import pytest
@pytest.mark.priority('p0')
def test_a():
pass
@pytest.mark.priority('p1')
def test_b():
pass
@pytest.mark.priority('p2')
def test_c():
pass
- 筛选测试用例,例如运行优先级为p0和p1的用例
pytest test_demo.py --priority=p0 --priority=p1
Release files for pytest-priority 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_priority-0.1.1.tar.gz | 2.1 kB | Details |
Release files / pytest_priority-0.1.1.tar.gz
| Download URL | pytest_priority-0.1.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86fa9c95a26b90f1f086529a9f10ca2f3d7185f3c9c17897b53719f2945a59c9
|
|
BLAKE2b-256 checksum How to use checksums |
fa444d37033f685809b9c5982ab55d85992aa3de0d0c444b84bfee0724a7ff88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|