Pytest+Allure是一款非常经典的测试框架,堪称完美!!!,但是有时候,我们在测试过程中,当自动化任务很多,需要部署很多的机器去跑工程时,我们又不希望去频繁的部署安装Python环境,所以大部分公司都会将测试框架及测试用例打包为exe文件去执行。
今天我在打包的过程中发现一个问题,通过编辑器去跑工程的时候,没有问题,但是打包exe执行的时候,报错error: unrecognized arguments:–count=1,–alluredir=result,网上各种论坛各种求助,依然没有解决,最后在TesterHome上解决了。非常感谢qinl(lang)的帮助。
附上当时的帖子:https://testerhome.com/topics/24526
life is short,show me the code!,直接上代码from allure_pytest import plugin as allure_plugin import pytest_repeat as repeat args = ['-s', '-v', '--count=3', '--alluredir=allure_result', test_path] pytest.main(args=args, plugins=[allure_plugin, repeat]) 1234