美文网首页
测试用例的运行

测试用例的运行

作者: 一二三开花 | 来源:发表于2020-10-29 13:47 被阅读0次

假如有多个测试用例,按照字母(ASCII编码)执行顺序
我们可以在不同的字母前面加数字表示先后顺序更方便简洁
eg:
test_login_2_falure
test_login_1_success

pycharm可以单独执行一个或者多个测试用例
命令行行模式(工作中少用)

python -m unittest test_module test_module1
python -m unittest test_module.TestClass
python -m unittest test_module.TestClass.test_method
你可以传入模块名,类或方法名或他们的任意组合

测试模块可以通过文件路径指定:

python -m unittest tests/test_something.py

相关文章

网友评论

      本文标题:测试用例的运行

      本文链接:https://www.haomeiwen.com/subject/djykvktx.html