简体   繁体   中英

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.

Answering on behalf of comments, indeed Additional Arguments in the Edit Configurations section does pass arguments through to py.test . My error was in misusing one of the arguments, obfuscating the fact that Additional Arguments was passing on the arguments as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM