Skip to content

hanzhichao/pytest-priority

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytest-Priority

为用例添加优先级标记,并支持按优先级筛选用例执行

安装方法

pip install pytest-priority

使用方法

  1. 标记优先级
# 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
  1. 筛选测试用例,例如运行优先级为p0和p1的用例
pytest test_demo.py --priority=p0 --priority=p1

About

为pytest测试用例添加优先级标记

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published