[英]In PyCharm, how do you add a custom parameter to pytest when running unittests?
我在pycharm中运行Python单元测试。 这将执行以下命令:
/<path>/python /<path>/_jb_pytest_runner.py --target my_function_test_base.py::MyFunctionTestBase
在// tests中使用参数my_function_test_base.py::MyFunctionTestBase启动pytest
我想添加一个在这个答案中找到的pytest选项--tb=1
: 使Python unittest显示AssertionError但没有Traceback
我不知道在PyCharm下该怎么做。
实际上,“ Edit Configurations”部分中的“ Additional Arguments”代表注释进行py.test
确实将参数传递给py.test
。 我的错误在于误用了其中一个参数,从而混淆了“ Additional Arguments
正在按预期传递Additional Arguments
的事实。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.