摘要:
有了这个插件提供了两个命令行选项来重新运行上次pytest调用的失败: # 在运行完用例后,再次运行,只重新运行之前失败的用例 --lf, --last-failed # 首先运行失败,然后运行其余的测试 --ff, --failed-first pytest -ff test_demo.py py 阅读全文
posted @ 2022-03-12 23:03
清风吹拂啊狂风肆虐
阅读(338)
评论(0)
推荐(0)
摘要:
跳过没有import导入成功的测试用例(Skipping on a missing import dependency) pexpect = pytest.importorskip("pexpect") 以命令的方式或者条件下去标记跳过或标记失败的用例: def test_function2(): 阅读全文
posted @ 2022-03-12 21:50
清风吹拂啊狂风肆虐
阅读(239)
评论(0)
推荐(0)
摘要:
你不想在window上运行: @pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows") class TestPosixCalls: def test_function(self): "will not 阅读全文
posted @ 2022-03-12 08:07
清风吹拂啊狂风肆虐
阅读(80)
评论(0)
推荐(0)
摘要:
控制台命令运行修改格式: --log-date-format="%Y-%m-%d %H:%M:%S" pytest.ini文件下添加以下代码,修改log输出: [pytest] log_format = %(asctime)s %(levelname)s %(message)s log_date_f 阅读全文
posted @ 2022-03-12 07:48
清风吹拂啊狂风肆虐
阅读(586)
评论(0)
推荐(0)

浙公网安备 33010602011771号