Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 627
David Parks Avatar asked Dec 29 '25 14:12

David Parks


1 Answers

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.

like image 66
David Parks Avatar answered Dec 31 '25 04:12

David Parks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!