Question
How to pass multiple pytest command line options in PyCharm?
Problem
Setting the pytest logging options --log-level=DEBUG --log-cli=True --log-cli-level=DEBUG fails with the error with the PyCharm Run Configuration.
Launching pytest with arguments --log-level=DEBUG --log-cli=True --log-cli-level=DEBUG ****/test_040_objective_sigmoid.py in ****
ERROR: usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] [...]
_jb_pytest_runner.py: error: unrecognized arguments: --log-cli=True
inifile: None
rootdir: ****
With single argument, it runs without an error.
Launching pytest with arguments --log-level=DEBUG ****test_040_objective_sigmoid.py in ****
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- ****/bin/python
cachedir: .pytest_cache
rootdir: ****
plugins: pytest_check-1.0.1
collecting ... collected 5 items
When running the pytest from command line, the pytest logging options work.
$ pytest --log-level=DEBUG --log-cli=True --log-cli-level=DEBUG --verbose --cache-clear -x ${DIR}
===============================================================================================
test session starts
===============================================================================================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
...
pytest setup in PyCharm
References



