python - In PyCharm, how do you add a custom parameter to pytest when running unittests?
问题描述
I'm running a Python unittest in pycharm. This executes the command:
/<path>/python /<path>/_jb_pytest_runner.py --target my_function_test_base.py::MyFunctionTestBase
Launching pytest with arguments my_function_test_base.py::MyFunctionTestBase in //tests
I would like to add a pytest option --tb=1
that I found in this answer: Make Python unittest show AssertionError but no Traceback
I don't know how to do that under PyCharm.
解决方案
代表评论回答,编辑配置部分中的附加参数确实将参数传递给py.test
. Additional Arguments
我的错误在于滥用其中一个论点,混淆了按预期传递论点的事实。
推荐阅读
- c - 可能由 strcpy 引起的 HardFault
- bash - 删除每次登录后我得到的 -Bash 错误
- python - python中线图上的数据光标
- c++ - 尝试在 C++ 中的 Windows 上进行一些基本的套接字编程并遇到库文件问题
- javascript - 无法访问 useReducer 值,返回空数组
- ionic-framework - 错误错误:未捕获(承诺):NullInjectorError:R3InjectorError(RegisterPageModule)[AccessProviders - > AccessProviders]
- c - exit(21) 代表什么?可以用 exit(1) 代替吗?
- c# - 使用实体框架将日期作为字符串传递给 Crystal Report
- excel - 如何将变量从表单传递到工作簿 VBA
- c++ - 尝试在自定义类(ESP8266)中使用 NTPClient 时出现异常