nosetest 搭建smoke测试用例集
来源:互联网 发布:人工智能疾病诊断 编辑:程序博客网 时间:2024/06/01 08:59
在很多时候,用例可以分不同的等级来运行,在nose中很增加了这个功能,使用attrib将用例进行划分。
用nose的这个特性搭建smoke测试用例集
test.py
import unittest from nose.plugins.attrib import attrdef level(lev): def wrap_ob(ob): setattr(ob,'level',lev) return ob return wrap_ob class Test(unittest.TestCase): def setUp(self): print "setup()" def tearDown(self): print "teardown()" @level(1) def test_1(self): print "test_1()" def test_2(self): print "test_2()" def test_sample(self): print "test_sample()" if __name__ == '__main__': unittest.main()运行命令nosetests -l -d -v -s --with-id -a level=1 test.py 结果
test_1()teardown()ok运行命令nosetests -l -d -v -s --with-id test.py 结果
#1 test_1 (test.Test) ... setup()test_1()teardown()ok#4 test_2 (test.Test) ... setup()test_2()teardown()ok#5 test_sample (test.Test) ... setup()test_sample()teardown()ok把smoke用例集使用@level(1)执行添加-a level=1
全量还按以前的执行
0 0
- nosetest 搭建smoke测试用例集
- Smoke Test (冒烟测试)
- python测试框架——unittest和nosetest
- 什么是冒烟测试(Smoke test)
- nosetest简介
- 软件测试:电商类应用的smoke测试流程
- 冒烟测试(smoke testing)&每日构建 (Daily Build)
- 详细介绍一下 Smoke Testing(冒烟测试)
- nosetest运行方式
- Smoke test
- Past smoke
- smoke test
- Smoke Testing
- Smoke testing
- Smoke Testing
- Smoke Test
- OJ---Peter's Smoke
- FLASH Smoke simulation
- 刷题小记
- 排序算法(四) 基数排序
- python中的metaclass 的精彩解释
- L1-033. 出生年
- app 启动过程
- nosetest 搭建smoke测试用例集
- nio demo
- Linux下Find指令的详细用法
- 蓝桥杯-特殊回文数
- git
- 状压dp之棋盘覆盖
- 启动Activity前检测
- 安装mysql时遇到的问题
- Design Pattern(9)-Facade Pattern