pycharm 调试带自定义命令行参数时报错

问题

自定义命令行参数代码如下:

def pytest_addoption(parser):
parser.addoption("–cmdopt", action=“store”, help=“test case path”,default=’./data’)

直接在命令行执行命令
pytest --cmdopt=./data. 可运行成功

现想在运行的时候debug代码,在pycharm中增加如下配置

报错信息

ERROR: usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] […]
_jb_pytest_runner.py: error: unrecognized arguments: --cmdopt
inifile: /Users/user/yingchat-test/automation/api/pytest.ini
rootdir: /Users/user/yingchat-test/automation/api

环境

platform darwin – Python 3.8.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 – /Users/user/PycharmProjects/pythonProject/pythonPro/api/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/user/yingchat-test/automation/api, configfile: pytest.ini